From aa55adce1f9108c6d6e2bdb40b62491d9ad12c50 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Thu, 19 Dec 2024 12:07:42 +0100 Subject: [PATCH 1/2] Skip CI run on docs changes --- .github/workflows/ci.yml | 15 ++++++++++++++- .github/workflows/conformance.yml | 6 +++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4a05888e9..845bc60d41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: min_k8s_version: ${{ steps.vars.outputs.min_k8s_version }} k8s_latest: ${{ steps.vars.outputs.k8s_latest }} helm_changes: ${{ steps.filter.outputs.charts }} + code_changes: ${{ steps.filter.outputs.code }} steps: - name: Checkout Repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -55,6 +56,14 @@ jobs: filters: | charts: - charts/nginx-gateway-fabric/**/* + docs: &docs + - design/** + - docs/** + - examples/** + - site/** + code: + - '**' + - '!*docs' - name: Output Variables id: vars @@ -78,6 +87,7 @@ jobs: name: Unit Tests runs-on: ubuntu-24.04 needs: vars + if: ${{ needs.vars.outputs.code_changes != 'true' }} steps: - name: Checkout Repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -109,6 +119,7 @@ jobs: name: NJS Unit Tests runs-on: ubuntu-24.04 needs: vars + if: ${{ needs.vars.outputs.code_changes != 'true' }} steps: - name: Checkout Repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -245,6 +256,7 @@ jobs: conformance-tests: name: Conformance tests needs: [vars, build-oss, build-plus] + if: ${{ ! failure() }} strategy: fail-fast: false matrix: @@ -260,6 +272,7 @@ jobs: image: ${{ matrix.image }} k8s-version: ${{ matrix.k8s-version }} enable-experimental: ${{ matrix.enable-experimental }} + if: ${{ (!github.event.pull_request.head.repo.fork || matrix.image != 'plus' ) && needs.vars.outputs.code_changes != 'true' }} secrets: inherit permissions: contents: write @@ -267,6 +280,7 @@ jobs: helm-tests: name: Helm Tests needs: [vars, build-oss, build-plus] + if: ${{ needs.vars.outputs.helm_changes == 'true' || github.event_name == 'schedule' }} strategy: fail-fast: false matrix: @@ -281,7 +295,6 @@ jobs: image: ${{ matrix.image }} k8s-version: ${{ matrix.k8s-version }} secrets: inherit - if: ${{ needs.vars.outputs.helm_changes == 'true' || github.event_name == 'schedule' }} publish-helm: name: Package and Publish Helm Chart diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 83deabf7e9..5eb15f0efe 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -12,6 +12,10 @@ on: enable-experimental: required: true type: boolean + if: + required: false + type: boolean + default: true defaults: run: @@ -24,7 +28,7 @@ jobs: conformance-tests: name: Run Tests runs-on: ubuntu-24.04 - if: ${{ !github.event.pull_request.head.repo.fork || inputs.image != 'plus' }} + if: ${{ inputs.if }} permissions: contents: write # needed for uploading release artifacts env: From 934d2abab6662912c519617691b15a1d2a87781e Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Thu, 19 Dec 2024 15:15:43 +0100 Subject: [PATCH 2/2] test --- .github/workflows/ci.yml | 8 ++++---- docs/test | 0 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 docs/test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 845bc60d41..7e4f7d68e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: min_k8s_version: ${{ steps.vars.outputs.min_k8s_version }} k8s_latest: ${{ steps.vars.outputs.k8s_latest }} helm_changes: ${{ steps.filter.outputs.charts }} - code_changes: ${{ steps.filter.outputs.code }} + docs_only_changes: ${{ steps.filter.outputs.docs && !steps.filter.outputs.code }} steps: - name: Checkout Repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -87,7 +87,7 @@ jobs: name: Unit Tests runs-on: ubuntu-24.04 needs: vars - if: ${{ needs.vars.outputs.code_changes != 'true' }} + if: ${{ needs.vars.outputs.docs_only_changes == 'true' }} steps: - name: Checkout Repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -119,7 +119,7 @@ jobs: name: NJS Unit Tests runs-on: ubuntu-24.04 needs: vars - if: ${{ needs.vars.outputs.code_changes != 'true' }} + if: ${{ needs.vars.outputs.docs_only_changes == 'true' }} steps: - name: Checkout Repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -272,7 +272,7 @@ jobs: image: ${{ matrix.image }} k8s-version: ${{ matrix.k8s-version }} enable-experimental: ${{ matrix.enable-experimental }} - if: ${{ (!github.event.pull_request.head.repo.fork || matrix.image != 'plus' ) && needs.vars.outputs.code_changes != 'true' }} + if: ${{ (!github.event.pull_request.head.repo.fork || matrix.image != 'plus' ) && needs.vars.outputs.docs_only_changes != 'true' }} secrets: inherit permissions: contents: write diff --git a/docs/test b/docs/test new file mode 100644 index 0000000000..e69de29bb2