From d322d9f7cbe289b593b9a95a6aeb0aba1bc41b82 Mon Sep 17 00:00:00 2001 From: Joerg Herbel Date: Thu, 9 Nov 2023 10:01:02 +0100 Subject: [PATCH 1/2] GitHub workflows: Some renaming CMK-15099 --- .github/workflows/release.yaml | 2 +- .github/workflows/{robotmk.yaml => robotmk_build.yaml} | 3 ++- .github/workflows/{ci.yaml => tests.yaml} | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) rename .github/workflows/{robotmk.yaml => robotmk_build.yaml} (97%) rename .github/workflows/{ci.yaml => tests.yaml} (98%) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a21059f5..9f4e92e2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,7 +16,7 @@ jobs: build_rcc: uses: ./.github/workflows/rcc.yaml build_robotmk: - uses: ./.github/workflows/robotmk.yaml + uses: ./.github/workflows/robotmk_build.yaml release: runs-on: ubuntu-latest needs: [build_rcc, build_robotmk] diff --git a/.github/workflows/robotmk.yaml b/.github/workflows/robotmk_build.yaml similarity index 97% rename from .github/workflows/robotmk.yaml rename to .github/workflows/robotmk_build.yaml index 1b7ce68f..20a03619 100644 --- a/.github/workflows/robotmk.yaml +++ b/.github/workflows/robotmk_build.yaml @@ -1,5 +1,6 @@ --- -name: "Robotmk" +name: "Build Robotmk" + on: push: paths: diff --git a/.github/workflows/ci.yaml b/.github/workflows/tests.yaml similarity index 98% rename from .github/workflows/ci.yaml rename to .github/workflows/tests.yaml index bc62670f..8078ba43 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/tests.yaml @@ -1,4 +1,4 @@ -name: CI +name: "Tests" on: [push, pull_request] From 759c94fe8a48debfa981204a99b9d26ed02b2fe8 Mon Sep 17 00:00:00 2001 From: Joerg Herbel Date: Wed, 8 Nov 2023 16:58:07 +0100 Subject: [PATCH 2/2] Implement CI workflow with check_success job which must always be green CMK-15099 --- .github/workflows/ci.yaml | 58 ++++++++++++++++++++++++++++ .github/workflows/rcc.yaml | 6 --- .github/workflows/release.yaml | 14 +++---- .github/workflows/robotmk_build.yaml | 6 --- .github/workflows/tests.yaml | 3 +- 5 files changed, 65 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..bf392dc5 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,58 @@ +--- +name: "CI" + +on: + push: + branches: + # Do not trigger on tags + # https://stackoverflow.com/questions/68573888/how-can-i-not-execute-a-github-action-when-i-push-a-new-tag + "**" + pull_request: + +jobs: + analyse_changes: + if: always() + runs-on: ubuntu-latest + outputs: + robotmk_yaml_changed: ${{ steps.filter.outputs.robotmk_yaml }} + rcc_yaml_changed: ${{ steps.filter.outputs.rcc_yaml }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + robotmk_yaml: + - '.github/workflows/robotmk.yaml' + rcc_yaml: + - '.github/workflows/rcc.yaml' + + tests: + if: always() + uses: ./.github/workflows/tests.yaml + + build_robotmk: + needs: + - analyse_changes + if: ${{ needs.analyse_changes.outputs.robotmk_yaml_changed == 'true' }} + uses: ./.github/workflows/robotmk_build.yaml + + rcc: + needs: + - analyse_changes + if: ${{ needs.analyse_changes.outputs.rcc_yaml_changed == 'true' }} + uses: ./.github/workflows/rcc.yaml + + check_success: + if: always() + runs-on: Ubuntu-latest + needs: + - tests + - build_robotmk + - rcc + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + allowed-skips: build_robotmk, rcc + jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/rcc.yaml b/.github/workflows/rcc.yaml index 9d8ec6f4..5ccae8c9 100644 --- a/.github/workflows/rcc.yaml +++ b/.github/workflows/rcc.yaml @@ -2,12 +2,6 @@ name: "RCC" on: - push: - paths: - - .github/workflows/rcc.yaml - pull_request: - paths: - - .github/workflows/rcc.yaml workflow_call: {} jobs: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9f4e92e2..a8ccd7e6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,18 +1,14 @@ --- name: "Upload all artifacts" + on: push: - paths: - - .github/workflows/release.yaml - - .github/workflows/rcc.yaml - - .github/workflows/robotmk.yaml - pull_request: - paths: - - .github/workflows/release.yaml - - .github/workflows/rcc.yaml - - .github/workflows/robotmk.yaml + tags: + "**" jobs: + tests: + uses: ./.github/workflows/tests.yaml build_rcc: uses: ./.github/workflows/rcc.yaml build_robotmk: diff --git a/.github/workflows/robotmk_build.yaml b/.github/workflows/robotmk_build.yaml index 20a03619..98dc9c4c 100644 --- a/.github/workflows/robotmk_build.yaml +++ b/.github/workflows/robotmk_build.yaml @@ -2,12 +2,6 @@ name: "Build Robotmk" on: - push: - paths: - - .github/workflows/robotmk.yaml - pull_request: - paths: - - .github/workflows/robotmk.yaml workflow_call: {} jobs: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8078ba43..df69a981 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,6 +1,7 @@ name: "Tests" -on: [push, pull_request] +on: + workflow_call: {} jobs: ci: