From 72596aea8d21d59040ebe05e8460cf4f3aeccf40 Mon Sep 17 00:00:00 2001 From: Faisal Memon Date: Tue, 16 May 2023 10:21:44 -0700 Subject: [PATCH] Skip tests for docs folders (#281) Our mandatory checks will fail if there are docs only changes. The helm-chart-ci.yaml skips these files, so the workflows never run, and the mandatory checks are stuck waiting for results. This adds a parallel workflow that runs fake tests for docs changes. So that docs only changes can pass the required status checks. It uses `paths-ignore` instead of `paths`. This is documented [here](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/troubleshooting-required-status-checks#handling-skipped-but-required-checks). --------- Signed-off-by: Faisal Memon Co-authored-by: Marco Franssen --- .github/workflows/helm-chart-ci-ignore.yaml | 61 +++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/helm-chart-ci-ignore.yaml diff --git a/.github/workflows/helm-chart-ci-ignore.yaml b/.github/workflows/helm-chart-ci-ignore.yaml new file mode 100644 index 0000000..d54a1ff --- /dev/null +++ b/.github/workflows/helm-chart-ci-ignore.yaml @@ -0,0 +1,61 @@ +name: Helm Chart CI + +on: + workflow_dispatch: + pull_request: + types: [synchronize, opened, reopened] + paths-ignore: + - 'charts/**' + - '.github/workflows/helm-chart-ci.yaml' + - '.github/kind/conf/kind-config.yaml' + - '.github/tests/**/*.yaml' + - '.github/tests/**/*.sh' + - '.github/tests/**/*.json' + - 'examples/**/*.yaml' + - 'helm-docs.sh' + +jobs: + lint-chart: + runs-on: ubuntu-22.04 + steps: + - run: 'echo "Skipping linter"' + + checks: + runs-on: ubuntu-22.04 + steps: + - run: 'echo "Skipping checks"' + + build-matrix: + name: Build matrix + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v3.5.2 + + - id: set-matrix + name: Collect all tests + run: | + tests="$(echo -e "default\n$(find .github/tests -maxdepth 1 -type d | grep -Ev 'tests$' | xargs -I % basename % | sort | uniq)")" + tests_json="$(echo "$tests" | jq -c --slurp --raw-input 'split("\n") | map(select(. != ""))')" + echo "tests=$tests_json" >> $GITHUB_OUTPUT + + outputs: + tests: ${{ steps.set-matrix.outputs.tests }} + + test: + runs-on: ubuntu-22.04 + needs: + - build-matrix + + strategy: + matrix: + k8s: + - v1.27.0 + - v1.26.3 + - v1.25.8 + values: + - ${{ fromJson(needs.build-matrix.outputs.tests) }} + + steps: + - run: 'echo "Skipping tests"'