From f9b44d282b4962bfdf8d27db22b8872b6da9647b Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Mon, 29 May 2023 11:20:59 +0200 Subject: [PATCH] chore(ci): improve CI performance (#9257) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** The CI was using an old devcontainer for things where this wasn't technically 100% needed. By removing it we can cut it down by another 50-70% for single-chart runs, such as container updates. **โš™๏ธ Type of change** - [ ] โš™๏ธ Feature/App addition - [x] ๐Ÿช› Bugfix - [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] ๐Ÿ”ƒ Refactor of current code **๐Ÿงช How Has This Been Tested?** **๐Ÿ“ƒ Notes:** **โœ”๏ธ Checklist:** - [x] โš–๏ธ My code follows the style guidelines of this project - [x] ๐Ÿ‘€ I have performed a self-review of my own code - [x] #๏ธโƒฃ I have commented my code, particularly in hard-to-understand areas - [x] ๐Ÿ“„ I have made corresponding changes to the documentation - [x] โš ๏ธ My changes generate no new warnings - [x] ๐Ÿงช I have added tests to this description that prove my fix is effective or that my feature works - [x] โฌ†๏ธ I increased versions for any altered app according to semantic versioning **โž• App addition** If this PR is an app addition please make sure you have done the following. - [ ] ๐Ÿชž I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] ๐Ÿ–ผ๏ธ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Kjeld Schouten --- .github/workflows/catalog-test.yaml | 18 ++++++------------ .github/workflows/charts-lint.yaml | 18 +++++++++++++----- .github/workflows/charts-test.yaml | 9 +++++++-- charts/stable/jackett/Chart.yaml | 2 +- charts/stable/sonarr/Chart.yaml | 2 +- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.github/workflows/catalog-test.yaml b/.github/workflows/catalog-test.yaml index 961e05eaba1..9bb44e20ffc 100644 --- a/.github/workflows/catalog-test.yaml +++ b/.github/workflows/catalog-test.yaml @@ -26,19 +26,13 @@ jobs: - name: Setting repo parent dir as safe safe.directory run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 - with: - repository: truecharts/catalog - path: catalog + ## TODO: Only run on the existing catalog when CI or template changes are actually detected + # - name: Checkout + # uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 + # with: + # repository: truecharts/catalog + # path: catalog - name: build-and-run run: | tools/build-release.sh - - - uses: vishnudxb/cancel-workflow@c3c77eb4383ba7d023e6614a07d94fe990501ac6 # tag=v1.2 - if: failure() - with: - repo: truecharts/charts - workflow_id: ${{ github.run_id }} - access_token: ${{ github.token }} diff --git a/.github/workflows/charts-lint.yaml b/.github/workflows/charts-lint.yaml index 6c129287d2c..5a82255908f 100644 --- a/.github/workflows/charts-lint.yaml +++ b/.github/workflows/charts-lint.yaml @@ -20,8 +20,6 @@ jobs: lint-and-verify: name: Lint Charts and Verify Dependencies runs-on: ubuntu-latest - container: - image: tccr.io/truecharts/devcontainer:v3.1.38@sha256:2fd9355bc6791461430db87a04f5fe7b49c46bc5957bc348f1efbff4c6c7913d steps: - name: Checkout uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 @@ -37,6 +35,17 @@ jobs: - name: Setting repo parent dir as safe safe.directory run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Install go-yq + run: | + mkdir -p $HOME/.local/bin + wget https://github.com/mikefarah/yq/releases/download/v4.26.1/yq_linux_amd64 -O $HOME/.local/bin/go-yq && \ + chmod +x $HOME/.local/bin/go-yq + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Install pre-commit, yamale and yamllint + run: | + pip3 install --no-cache-dir pre-commit yamale yamllint - name: Prep Helm run: | @@ -62,16 +71,15 @@ jobs: if [[ $(echo ${OUTPUT_JSON} | jq --compact-output '. | length') -gt 0 ]]; then echo "detected=true" >> "$GITHUB_OUTPUT" fi - + - name: Test and Fix Pre-Commit Issues shell: bash if: inputs.chartChangesDetected == 'true' run: | echo "Running pre-commit test-and-cleanup..." - pre-commit run --all ||: # Fix sh files to always be executable find . -name '*.sh' | xargs chmod +x - pre-commit run --all + pre-commit run --all || pre-commit run --all - name: Fetch and Verify dependencies shell: bash diff --git a/.github/workflows/charts-test.yaml b/.github/workflows/charts-test.yaml index 133aa3ad305..bc7d59298ef 100644 --- a/.github/workflows/charts-test.yaml +++ b/.github/workflows/charts-test.yaml @@ -18,8 +18,6 @@ jobs: generate-install-matrix: name: Generate matrix for install runs-on: ubuntu-latest - container: - image: tccr.io/truecharts/devcontainer:v3.1.38@sha256:2fd9355bc6791461430db87a04f5fe7b49c46bc5957bc348f1efbff4c6c7913d outputs: matrix1: | { @@ -57,6 +55,13 @@ jobs: with: fetch-depth: 1 ref: ${{ inputs.checkoutCommit }} + + - name: Install go-yq + run: | + mkdir -p $HOME/.local/bin + wget https://github.com/mikefarah/yq/releases/download/v4.26.1/yq_linux_amd64 -O $HOME/.local/bin/go-yq && \ + chmod +x $HOME/.local/bin/go-yq + echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Run chart-testing (list-changed) id: list-changed diff --git a/charts/stable/jackett/Chart.yaml b/charts/stable/jackett/Chart.yaml index 7ab24d2de19..be63977f04f 100644 --- a/charts/stable/jackett/Chart.yaml +++ b/charts/stable/jackett/Chart.yaml @@ -22,7 +22,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/stable/jackett - https://github.com/Jackett/Jackett type: application -version: 14.0.27 +version: 14.0.28 annotations: truecharts.org/catagories: | - media diff --git a/charts/stable/sonarr/Chart.yaml b/charts/stable/sonarr/Chart.yaml index 77b58feeb9c..6b1aea85edb 100644 --- a/charts/stable/sonarr/Chart.yaml +++ b/charts/stable/sonarr/Chart.yaml @@ -22,7 +22,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/stable/sonarr - https://github.com/Sonarr/Sonarr type: application -version: 15.0.20 +version: 15.0.21 annotations: truecharts.org/catagories: | - media