From 4f1307741a15f7ae638c172b29472d50cb178477 Mon Sep 17 00:00:00 2001 From: "Sean C. Sullivan" Date: Sun, 15 Nov 2020 05:49:58 -0800 Subject: [PATCH] add GitHub Actions CI --- .github/workflows/cross-version.yml | 27 ++++++++++++++ .github/workflows/main.yml | 56 +++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 .github/workflows/cross-version.yml create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml new file mode 100644 index 0000000..167fdf7 --- /dev/null +++ b/.github/workflows/cross-version.yml @@ -0,0 +1,27 @@ +name: Cross-Version + +on: [push, pull_request] + +jobs: + + test_java: + name: Java ${{ matrix.java }} + strategy: + fail-fast: false + matrix: + java: [14, 15, 16-ea] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Cache Maven Repository + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven + - name: Test + run: ./mvnw -V --no-transfer-progress -e clean verify javadoc:javadoc diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..52bdf95 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,56 @@ +name: CI + +on: [push, pull_request] + +jobs: + + test_os: + name: OS ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache Maven Repository + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven + - name: Test + run: ./mvnw -V --no-transfer-progress -e clean verify javadoc:javadoc + + sonar: + name: Sonar code analysis + runs-on: ubuntu-latest + if: github.repository == 'assertj/assertj-assertions-generator-maven-plugin' && github.event_name == 'push' + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache Maven Repository + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven + - name: Test with Sonar + run: > + ./mvnw -V --no-transfer-progress -e clean verify javadoc:javadoc + org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.organization=assertj + -Dsonar.projectKey=joel-costigliola_assertj-assertions-generator-maven-plugin + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}