From 433dca8a8d3ff0d71adb3afa2a359145a3fa61bf Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 2 Nov 2022 11:38:13 +0100 Subject: [PATCH] action: build, test and report test results (#152) --- .github/workflows/test-reporter.yml | 20 ++++++++++++++++++ .github/workflows/test.yml | 32 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/test-reporter.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test-reporter.yml b/.github/workflows/test-reporter.yml new file mode 100644 index 0000000..62879b3 --- /dev/null +++ b/.github/workflows/test-reporter.yml @@ -0,0 +1,20 @@ +--- +## Workflow to process the JUnit test results and add a report to the checks. +name: Test Report +on: + workflow_run: + workflows: + - test + types: + - completed + +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 + with: + artifact: test-results # artifact name + name: JUnit Tests # Name of the check run which will be created + path: "**/*.xml" # Path to test results (inside artifact .zip) + reporter: java-junit # Format of test results diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..394ac45 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Run build + run: make build + + - name: Run test + run: make test + + - name: Store test results + if: success() || failure() + uses: actions/upload-artifact@v3 + with: + name: test-results + path: target/*.xml +