From e96c8d24bfb4a5ef6de7e6426bfd06c5d3b4ca06 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 6 Feb 2024 15:48:57 +0100 Subject: [PATCH] github-actions: support for only docs (#33) --- .github/workflows/ci-docs.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 2 ++ .github/workflows/e2e-docs.yml | 27 +++++++++++++++++++++++++++ .github/workflows/e2e.yml | 2 ++ 4 files changed, 64 insertions(+) create mode 100644 .github/workflows/ci-docs.yml create mode 100644 .github/workflows/e2e-docs.yml diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml new file mode 100644 index 0000000..631600c --- /dev/null +++ b/.github/workflows/ci-docs.yml @@ -0,0 +1,33 @@ +# This workflow sets the 'test-windows' and 'builds' status check to success in case it's a docs only PR and ci.yml is not triggered +# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks +name: Pull Request Validation # The name must be the same as in ci.yml + +on: + pull_request: + paths-ignore: # This expression needs to match the paths ignored on ci.yml. + - '**' + - '!*.md' + - '!*.asciidoc' + - '!docs/**' + +permissions: + contents: read + +## Concurrency only allowed in the main branch. +## So old builds running for old commits within the same Pull Request are cancelled +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + # dummy steps that allow to bypass those mandatory checks for tests + test-windows: + runs-on: ubuntu-latest + steps: + - run: 'echo "Not required for docs"' + + # dummy steps that allow to bypass those mandatory checks for tests + build: + runs-on: ubuntu-latest + steps: + - run: 'echo "Not required for docs"' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d877e51..07e912c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,8 @@ concurrency: env: NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages +# NOTE: if you add a new job and it's a mandatory check then +# update ci.yml jobs: test-windows: runs-on: windows-latest diff --git a/.github/workflows/e2e-docs.yml b/.github/workflows/e2e-docs.yml new file mode 100644 index 0000000..e9b37f1 --- /dev/null +++ b/.github/workflows/e2e-docs.yml @@ -0,0 +1,27 @@ +# This workflow sets the 'test' status check to success in case it's a docs only PR and e2e.yml is not triggered +# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks +name: e2e # The name must be the same as in e2e.yml + +on: + pull_request: + paths-ignore: # This expression needs to match the paths ignored on e2e.yml. + - '**' + - '!*.md' + - '!*.asciidoc' + - '!docs/**' + +permissions: + contents: read + +## Concurrency only allowed in the main branch. +## So old builds running for old commits within the same Pull Request are cancelled +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + # dummy steps that allow to bypass those mandatory checks for tests + test: + runs-on: ubuntu-latest + steps: + - run: 'echo "Not required for docs"' diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c1ee6f6..fdc78a9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -25,6 +25,8 @@ env: # keep_serverless-staging-oblt OR keep_serverless-qa-oblt SERVERLESS_PROJECT: serverless-production-oblt +# NOTE: if you add a new job and it's a mandatory check then +# update e2e-docs.yml jobs: test: if: |