From 85f7a1ba5f449460c751d4e4037657df2e308648 Mon Sep 17 00:00:00 2001 From: Harald Klimach Date: Thu, 22 May 2025 15:24:16 +0200 Subject: [PATCH 1/2] Run system tests for non-draft PRs --- .github/workflows/compile.yml | 25 ++++++++++++++++++++++++- README.md | 2 ++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index b328eef..45716a8 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -1,4 +1,4 @@ -name: Compilation and UTests +name: Compilation and Tests on: workflow_call: @@ -10,10 +10,14 @@ on: jobs: build-debug-utest: + id: build-utest permissions: checks: write pull-requests: write runs-on: ubuntu-latest + concurrency: + group: compile-testing-${{ github.ref }} + cancel-in-progress: true steps: - name: Checkout Code uses: actions/checkout@v4 @@ -31,3 +35,22 @@ jobs: files: | build/**/waf-utest.xml check_name: "Waf Unit Tests" + + system-test: + needs: build-utest + if: github.event.pull_request.draft == false + permissions: + checks: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Run system tests + id: pysys + uses: apes-suite/pysys-action@v1.0.0 + + - name: Upload archive artifacts for any test failures + uses: actions/upload-artifact@v4 + if: always() && steps.pysys.outputs.artifact_TestOutputArchiveDir + with: + name: pysys_output + path: ${{ steps.pysys.outputs.artifact_TestOutputArchiveDir }} diff --git a/README.md b/README.md index d501674..6a79e4a 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Reusable Github workflows for the APES repositories The waf unit tests are being run and their report is published accordingly. This should only be run in pull request. Needs the permission to write `checks` and `pull-requests`. + If the pull request is not a draft, this workflow proceeds to run the + system tests with pysys. * **ford.yml**: create FORD documentation with waf and deploy it to the github pages of the repository. Takes a `name` indicating the tool for which the From 442034d335290753d8a989a64b7130b7058fef15 Mon Sep 17 00:00:00 2001 From: Harald Klimach Date: Thu, 22 May 2025 15:41:37 +0200 Subject: [PATCH 2/2] compile.yml: introduce systest option --- .github/workflows/compile.yml | 6 +++++- README.md | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 45716a8..6c11623 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -7,6 +7,10 @@ on: description: 'Name of the tool to compile' required: true type: string + systest: + description: 'Whether to run pysys-tests after compilation' + default: false + type: boolean jobs: build-debug-utest: @@ -38,7 +42,7 @@ jobs: system-test: needs: build-utest - if: github.event.pull_request.draft == false + if: inputs.systest == true permissions: checks: write pull-requests: write diff --git a/README.md b/README.md index 6a79e4a..22898d8 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,15 @@ Reusable Github workflows for the APES repositories * **compile.yml**: compile `build debug` with the build-action for an APES tool. Takes a `name` input parameter to label the build step accordingly. + The `systest` input parameter is a boolean that indicates whether pysys tests + should be run after a successful compilation. + For example the caller may want to run the system tests only for pull requests + that are no longer in draft mode and could pass + `${{ github.event.pull_request.draft == false }}`. The waf unit tests are being run and their report is published accordingly. This should only be run in pull request. Needs the permission to write `checks` and `pull-requests`. - If the pull request is not a draft, this workflow proceeds to run the + If `systest` is `true`, the workflow proceeds to run the system tests with pysys. * **ford.yml**: create FORD documentation with waf and deploy it to the github