From 41500fd8e56bd13565afbd74bf9924cc92d2c4ec Mon Sep 17 00:00:00 2001 From: Emmanuel Bourg Date: Fri, 12 May 2023 14:52:58 +0200 Subject: [PATCH] CI build with GitHub Actions instead of Travis --- .github/workflows/build.yml | 65 +++++++++++++++++++++++++++++++++++++ .travis.yml | 22 ------------- README.md | 2 +- 3 files changed, 66 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..f5161076 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,65 @@ +# Github action performing the following operations: +# - Define an environment variable STOREPASS=password +# - Build the Maven project with Java 8, Java 11 and Java 17 as a matrix. The JDK is provided by Temurin +# - As a post build step, run the tests and upload test coverage to Coveralls. + +name: build + +on: + push: + branches: [ '*' ] + pull_request: + branches: [ master ] + +env: + STOREPASS: password + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: [ 8, 11, 17 ] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Java ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: 'maven' + + - name: Compile + run: | + mvn -version + mvn -B clean compile + + - name: Tests + run: mvn -B test + + - name: Packaging + run: mvn -B package -DskipTests + + - name: Coverage report + run: mvn -B clean test jacoco:report-aggregate coveralls:report -DjacocoReports=jsign/target/site/jacoco-aggregate/jacoco.xml -DrepoToken=${{ secrets.COVERALLS_TOKEN }} || true + + experimental: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v3 + + - name: Set up Java 20 + uses: actions/setup-java@v3 + with: + java-version: 20 + distribution: 'temurin' + cache: 'maven' + + - name: Build + run: | + mvn -version + mvn -B clean package || true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e222e290..00000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: java -jdk: - - openjdk20 - - openjdk17 - - openjdk11 - - openjdk8 - -env: - global: - - STOREPASS=password - -matrix: - fast_finish: true - allow_failures: - - jdk: openjdk20 - -after_success: - - mvn clean test jacoco:report-aggregate coveralls:report -DjacocoReports=jsign/target/site/jacoco-aggregate/jacoco.xml - -cache: - directories: - - $HOME/.m2 diff --git a/README.md b/README.md index ff15ab6c..0c1642c7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Jsign - Java implementation of Microsoft Authenticode ===================================================== -[![Build Status](https://api.travis-ci.com/ebourg/jsign.svg)](https://app.travis-ci.com/github/ebourg/jsign) +[![Build Status](https://github.com/ebourg/jsign/actions/workflows/build.yml/badge.svg?branch=master&event=push)](https://github.com/ebourg/jsign/actions/workflows/build.yml) [![Coverage Status](https://coveralls.io/repos/github/ebourg/jsign/badge.svg?branch=master)](https://coveralls.io/github/ebourg/jsign?branch=master) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Maven Central](https://img.shields.io/maven-central/v/net.jsign/jsign.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22net.jsign%22)