From 3465713d9ab8a4daf358028587556ea5d08eea6e Mon Sep 17 00:00:00 2001 From: Stacky McStackface Date: Thu, 11 Apr 2024 09:25:29 +0000 Subject: [PATCH] Generated commit to update templated files based on rev 8dde343 in stackabletech/operator-templating repo. Triggered by: Manual run triggered by: fhennig with message [feat(github-actions): split off README check and narrow scope for build.yml] --- .github/workflows/build.yml | 34 ++++--------------------- .github/workflows/check_readme.yml | 40 ++++++++++++++++++++++++++++++ Makefile | 10 ++++++-- renovate.json | 2 +- 4 files changed, 54 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/check_readme.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6320009d..b05eb5ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,10 @@ on: tags: - '[0-9][0-9].[0-9]+.[0-9]+' pull_request: + paths-ignore: + - 'docs/**' + - '.readme/**' + - '*.md' merge_group: env: @@ -210,34 +214,6 @@ jobs: cache-all-crates: "true" - run: cargo test - - # Similar to check_charts, this tries to render the README, and see if there are unintended changes. - # This will save us from merging changes to the wrong file (instead of the templated source), and from - # forgetting to render out modifications to the README. - check_readme: - name: Check if committed README is the one we would render from the available parts - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - submodules: recursive - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # tag=v5.0.0 - with: - python-version: '3.11' - - name: Install jinja2-cli - run: pip install jinja2-cli==0.8.2 - - name: Regenerate charts - run: make render-readme - - name: Check if committed README were up to date - run: git diff --exit-code - - name: Git Diff showed uncommitted changes - if: ${{ failure() }} - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - script: | - core.setFailed('Committed README are not up to date, please make sure to apply them to the templated partials, and re-commit!') - # This job cleans up the CRDs and Helm charts, followed by rebuilding them # It then runs a `git diff` and fails the entire workflow, if any difference is encountered. # @@ -373,7 +349,7 @@ jobs: steps: - name: Install preflight run: | - wget https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/1.7.2/preflight-linux-amd64 + wget https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/1.9.1/preflight-linux-amd64 chmod +x preflight-linux-amd64 - name: Check container run: ./preflight-linux-amd64 check container "$IMAGE_TAG" > preflight.out diff --git a/.github/workflows/check_readme.yml b/.github/workflows/check_readme.yml new file mode 100644 index 00000000..fbdded19 --- /dev/null +++ b/.github/workflows/check_readme.yml @@ -0,0 +1,40 @@ +# ============= +# This file is automatically generated from the templates in stackabletech/operator-templating +# DON'T MANUALLY EDIT THIS FILE +# ============= +# Similar to check_charts, this tries to render the README, and see if there are unintended changes. +# This will save us from merging changes to the wrong file (instead of the templated source), and from +# forgetting to render out modifications to the README. +--- +name: Check README + +on: + pull_request: + paths: + - '.readme/**' + - 'README.md' + +jobs: + check_readme: + name: Check if committed README is the one we would render from the available parts + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + submodules: recursive + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # tag=v5.0.0 + with: + python-version: '3.11' + - name: Install jinja2-cli + run: pip install jinja2-cli==0.8.2 + - name: Regenerate charts + run: make render-readme + - name: Check if committed README were up to date + run: git diff --exit-code + - name: Git Diff showed uncommitted changes + if: ${{ failure() }} + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + core.setFailed('Committed README are not up to date, please make sure to apply them to the templated partials, and re-commit!') diff --git a/Makefile b/Makefile index 8aeeff71..0142e45a 100644 --- a/Makefile +++ b/Makefile @@ -150,9 +150,15 @@ build: regenerate-charts regenerate-nix helm-package docker-build publish: docker-publish helm-publish -run-dev: +check-nix: + @which nix || (echo "Error: 'nix' is not installed. Please install it to proceed."; exit 1) + +check-kubernetes: + @kubectl cluster-info > /dev/null 2>&1 || (echo "Error: Kubernetes is not running or kubectl is not properly configured."; exit 1) + +run-dev: check-nix check-kubernetes kubectl apply -f deploy/stackable-operators-ns.yaml nix run -f. tilt -- up --port 5430 --namespace stackable-operators -stop-dev: +stop-dev: check-nix check-kubernetes nix run -f. tilt -- down diff --git a/renovate.json b/renovate.json index d8e60f1a..8d633e2a 100644 --- a/renovate.json +++ b/renovate.json @@ -28,5 +28,5 @@ "after 5:00 and before 6:00 every weekday" ] }, - "ignorePaths": [".github/workflows/build.yml", ".github/workflows/general_daily_security.yml", ".github/workflows/pr_reviewdog.yaml"] + "ignorePaths": [".github/workflows/build.yml", ".github/workflows/check_readme.yml", ".github/workflows/general_daily_security.yml", ".github/workflows/pr_reviewdog.yaml"] }