Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/_check-compliance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
workflow_call: {}

jobs:
compliance:
name: Check Compliance
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Initialize Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
cache: 'maven'

- name: Run checks
run: >-
./mvnw
-B
-Pdependency-scan
-T8
-U
--no-transfer-progress
-DskipTests=true
-Dstyle.color=always
-Dmaven.main.skip
-Dmaven.jar.skip
-Dmaven.resources.skip
-Dmaven.test.skip
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
verify

- name: Archive Dependency Scan reports
uses: actions/upload-artifact@v3
if: always()
with:
name: dependency-scan-report
path: |
**/target/dependency-check-report.html
retention-days: 30
37 changes: 37 additions & 0 deletions .github/workflows/_generate-javadocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
workflow_call: {}

jobs:
generate-javadocs:
name: Generate
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Initialize Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
# Must use >= JDK 17 for JavaDocs to generate correctly.
java-version: 17
cache: 'maven'

- name: Generate JavaDocs
run: >-
./mvnw
-B
-T8
-U
-pl java-compiler-testing
--also-make
--no-transfer-progress
-Dmaven.test.skip=true
-Dcheckstyle.skip=true
-Dlicense.skip=true
-Dstyle.color=always
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
clean compile javadoc:jar
51 changes: 51 additions & 0 deletions .github/workflows/_publish_snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on:
workflow_call: {}

jobs:
github:
name: "Deploy Snapshot to GitHub"
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
pages: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Initialize JDK
uses: actions/setup-java@v3
with:
distribution: zulu
# Must use >= JDK 17 for Javadocs to generate correctly.
java-version: 17

- name: Build and deploy Maven artifacts
run: >-
./mvnw
-B
-T4C
--no-transfer-progress
-pl java-compiler-testing
--also-make
-Dmaven.source.includePom=true
-Dmaven.test.skip=true
-Dstyle.color=always
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
clean install javadoc:jar source:jar deploy
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload JavaDocs as a build artifact
uses: actions/upload-pages-artifact@v1
with:
path: java-compiler-testing/target/apidocs

- name: Deploy JavaDocs build artifact to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
123 changes: 123 additions & 0 deletions .github/workflows/_run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
on:
workflow_call: {}
workflow_dispatch: {}

jobs:
run-tests:
strategy:
fail-fast: false
matrix:
os-name:
- ubuntu-latest
java-version:
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
# Mockito currently does not support this distribution.
# - 20-ea
include:
- os-name: macos-latest
java-version: 11
- os-name: windows-latest
java-version: 11

name: Tests - JDK ${{ matrix.java-version }} - ${{ matrix.os-name }}
runs-on: ${{ matrix.os-name }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Initialize JDK
uses: actions/setup-java@v3
with:
cache: maven
check-latest: true
distribution: zulu
java-version: ${{ matrix.java-version }}

- name: Compile and run tests
run: >-
./mvnw
-B
-T8
-U
--no-transfer-progress
'-Dcheckstyle.skip=true'
'-Dlicense.skip=true'
'-Dstyle.color=always'
'-Dmaven.wagon.httpconnectionManager.ttlSeconds=120'
clean verify

- name: Annotate test reports with build environment info
if: always()
run: >-
scripts/prepare-test-outputs-for-merge.sh
${{ matrix.java-version }}
${{ matrix.os-name }}

- name: Archive Surefire and Jacoco reports
uses: actions/upload-artifact@v3
if: always()
with:
name: reports-java-${{ matrix.java-version }}-${{ matrix.os-name }}
path: |-
**/target/surefire-reports/*.xml
**/target/surefire-reports/*.txt
**/target/site/jacoco/jacoco*.xml
retention-days: 5

publish-test-reports:
name: Publish test reports
runs-on: ubuntu-latest
if: always()
needs:
- run-tests

permissions:
checks: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# Needed to keep actions working correctly.
fetch-depth: 2

- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: 'artifacts/'

- name: Publish to codecov
continue-on-error: true
if: always()
run: |-
curl --fail https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl --fail -Os https://uploader.codecov.io/latest/linux/codecov
curl --fail -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl --fail -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod -v +x codecov
./codecov

- name: Publish unit test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
continue-on-error: true
with:
json_test_case_results: true
json_thousands_separator: ","
junit_files: "artifacts/**/TEST-*.xml"
report_individual_runs: true
time_unit: "milliseconds"
Loading