From 70fe6869de70af9951167579be62de3ffd2e6ec7 Mon Sep 17 00:00:00 2001 From: Adam Gent Date: Sat, 18 Nov 2023 13:42:45 -0500 Subject: [PATCH 1/2] Github build,test action and dependabot Use 11 because apparently Temurin does not have 9 Make action load submodule --- .github/dependabot.yml | 7 ++++++ .github/workflows/maven.yml | 40 +++++++++++++++++++++++++++++++ .github/workflows/test-report.yml | 16 +++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/maven.yml create mode 100644 .github/workflows/test-report.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..6da8cf9 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: +- package-ecosystem: maven + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 10 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..1fa0d66 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,40 @@ +name: Build with Maven + +on: + push: + branches: [ github_action ] + pull_request: + branches: [ github_action ] + workflow_dispatch: + +jobs: + build: + + strategy: + matrix: + java: ['11', '17', '21'] + + runs-on: ubuntu-latest + env: + BUILD_NUMBER: "${{github.run_number}}" + MAVEN_CLI_OPTS: "--batch-mode --no-transfer-progress" + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'true' + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: 'maven' + - name: Build and Test with Maven + run: mvn $MAVEN_CLI_OPTS clean verify + - name: Upload Test Results + uses: actions/upload-artifact@v3 + if: ${{ always() && matrix.java == '11' }} + with: + name: test-results + path: 'target/surefire-reports/TEST-*.xml' + diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 0000000..4cc8b57 --- /dev/null +++ b/.github/workflows/test-report.yml @@ -0,0 +1,16 @@ +name: 'Test Report' +on: + workflow_run: + workflows: ['Build with Maven'] + types: + - completed +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: test-results + name: Maven Surefire Tests + path: 'TEST-*.xml' + reporter: java-junit From 6a453fc6563c01b73e65028f2a942e143c0cba28 Mon Sep 17 00:00:00 2001 From: Adam Gent Date: Sat, 18 Nov 2023 15:07:27 -0500 Subject: [PATCH 2/2] Switch branch to master --- .github/workflows/maven.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 1fa0d66..67dafc4 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -2,9 +2,9 @@ name: Build with Maven on: push: - branches: [ github_action ] + branches: [ master ] pull_request: - branches: [ github_action ] + branches: [ master ] workflow_dispatch: jobs: