Changes from gocardless/gocardless-pro-java-template #209
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build & test | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
jdk-version: [ 8, 11 ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v2 | |
with: | |
java-version: "${{ matrix.jdk-version }}" | |
distribution: adopt | |
- name: Verify java installed properly | |
run: java -version | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
# test | |
- name: Test | |
run: |- | |
export TERM=${TERM:-dumb} | |
./gradlew test | |
# test build | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Save test results | |
if: always() | |
run: |- | |
mkdir -p ~/junit | |
find . -type f -regex "./build/test-results/test/.*xml" -exec cp {} ~/junit/ \; | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test_library_jdk${{ matrix.jdk-version }}_junit | |
path: "~/junit" | |
retention-days: 7 |