From a925841b9e667c10b9b2ae9d95ef74e9f910b9b7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 13:15:09 +0300 Subject: [PATCH 1/5] chore(deps): update 1337kavin/piped-proxy:latest docker digest to b2c3add (#143) --- charts/apps/piped/Chart.yaml | 8 +++----- charts/apps/piped/README.md | 4 ++-- charts/apps/piped/values.yaml | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/charts/apps/piped/Chart.yaml b/charts/apps/piped/Chart.yaml index 7aa6043..5af7ce7 100644 --- a/charts/apps/piped/Chart.yaml +++ b/charts/apps/piped/Chart.yaml @@ -10,7 +10,7 @@ sources: - https://github.com/TeamPiped/piped-proxy keywords: - streaming -version: 7.3.0 +version: 7.3.1 appVersion: latest kubeVersion: ">=1.26.0-0" maintainers: @@ -27,7 +27,5 @@ dependencies: condition: postgresql.enabled annotations: artifacthub.io/changes: |- - - kind: fixed - description: templating of environment variables for backend init-containers. - - kind: fixed - description: templating of environment variables for frontend init-containers. + - kind: changed + description: Updated image for `ytproxy` from latest@sha256:53575a0aa0f5ea81f66f6f43d4c74333559efd62c99c21588dfee0aacbab2265 to latest@sha256:b2c3add82a3ab35c417abbb3539fe89e51284357ddf790ba82eb6fca3006f506 diff --git a/charts/apps/piped/README.md b/charts/apps/piped/README.md index a353a00..1625b13 100644 --- a/charts/apps/piped/README.md +++ b/charts/apps/piped/README.md @@ -1,6 +1,6 @@ # piped -![Version: 7.2.4](https://img.shields.io/badge/Version-7.2.4-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 7.3.1](https://img.shields.io/badge/Version-7.3.1-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) Piped is an alternative privacy-friendly YouTube frontend which is efficient by design. @@ -113,7 +113,7 @@ The following table contains an overview of available values and their descripti | ytproxy.enabled | bool | `true` | | | ytproxy.image.pullPolicy | string | `"IfNotPresent"` | image pull policy | | ytproxy.image.repository | string | `"1337kavin/piped-proxy"` | image repository | -| ytproxy.image.tag | string | `"latest@sha256:53575a0aa0f5ea81f66f6f43d4c74333559efd62c99c21588dfee0aacbab2265"` | image tag | +| ytproxy.image.tag | string | `"latest@sha256:b2c3add82a3ab35c417abbb3539fe89e51284357ddf790ba82eb6fca3006f506"` | image tag | | ytproxy.service.main.enabled | bool | `true` | | | ytproxy.service.main.ports.http.enabled | bool | `true` | | | ytproxy.service.main.ports.http.port | int | `8080` | | diff --git a/charts/apps/piped/values.yaml b/charts/apps/piped/values.yaml index 51deac4..ea9475c 100644 --- a/charts/apps/piped/values.yaml +++ b/charts/apps/piped/values.yaml @@ -142,7 +142,7 @@ ytproxy: # -- image repository repository: 1337kavin/piped-proxy # -- image tag - tag: "latest@sha256:53575a0aa0f5ea81f66f6f43d4c74333559efd62c99c21588dfee0aacbab2265" # Manifest index / Index Digest + tag: "latest@sha256:b2c3add82a3ab35c417abbb3539fe89e51284357ddf790ba82eb6fca3006f506" # Manifest index / Index Digest # -- image pull policy pullPolicy: IfNotPresent From 76daf41724de88fa53beb292b481fb01ad5bef95 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 13:28:42 +0300 Subject: [PATCH 2/5] chore(deps): update 1337kavin/piped-proxy:latest docker digest to d53bcf3 (#144) --- charts/apps/piped/Chart.yaml | 4 ++-- charts/apps/piped/README.md | 4 ++-- charts/apps/piped/values.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/apps/piped/Chart.yaml b/charts/apps/piped/Chart.yaml index 5af7ce7..e6cad40 100644 --- a/charts/apps/piped/Chart.yaml +++ b/charts/apps/piped/Chart.yaml @@ -10,7 +10,7 @@ sources: - https://github.com/TeamPiped/piped-proxy keywords: - streaming -version: 7.3.1 +version: 7.3.2 appVersion: latest kubeVersion: ">=1.26.0-0" maintainers: @@ -28,4 +28,4 @@ dependencies: annotations: artifacthub.io/changes: |- - kind: changed - description: Updated image for `ytproxy` from latest@sha256:53575a0aa0f5ea81f66f6f43d4c74333559efd62c99c21588dfee0aacbab2265 to latest@sha256:b2c3add82a3ab35c417abbb3539fe89e51284357ddf790ba82eb6fca3006f506 + description: Updated image for `ytproxy` from latest@sha256:b2c3add82a3ab35c417abbb3539fe89e51284357ddf790ba82eb6fca3006f506 to latest@sha256:d53bcf3eb0eb944656e0606a402c26a6e2e6247b32c4200030fa72b8ad79379f diff --git a/charts/apps/piped/README.md b/charts/apps/piped/README.md index 1625b13..41eb05a 100644 --- a/charts/apps/piped/README.md +++ b/charts/apps/piped/README.md @@ -1,6 +1,6 @@ # piped -![Version: 7.3.1](https://img.shields.io/badge/Version-7.3.1-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 7.3.2](https://img.shields.io/badge/Version-7.3.2-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) Piped is an alternative privacy-friendly YouTube frontend which is efficient by design. @@ -113,7 +113,7 @@ The following table contains an overview of available values and their descripti | ytproxy.enabled | bool | `true` | | | ytproxy.image.pullPolicy | string | `"IfNotPresent"` | image pull policy | | ytproxy.image.repository | string | `"1337kavin/piped-proxy"` | image repository | -| ytproxy.image.tag | string | `"latest@sha256:b2c3add82a3ab35c417abbb3539fe89e51284357ddf790ba82eb6fca3006f506"` | image tag | +| ytproxy.image.tag | string | `"latest@sha256:d53bcf3eb0eb944656e0606a402c26a6e2e6247b32c4200030fa72b8ad79379f"` | image tag | | ytproxy.service.main.enabled | bool | `true` | | | ytproxy.service.main.ports.http.enabled | bool | `true` | | | ytproxy.service.main.ports.http.port | int | `8080` | | diff --git a/charts/apps/piped/values.yaml b/charts/apps/piped/values.yaml index ea9475c..4f84115 100644 --- a/charts/apps/piped/values.yaml +++ b/charts/apps/piped/values.yaml @@ -142,7 +142,7 @@ ytproxy: # -- image repository repository: 1337kavin/piped-proxy # -- image tag - tag: "latest@sha256:b2c3add82a3ab35c417abbb3539fe89e51284357ddf790ba82eb6fca3006f506" # Manifest index / Index Digest + tag: "latest@sha256:d53bcf3eb0eb944656e0606a402c26a6e2e6247b32c4200030fa72b8ad79379f" # Manifest index / Index Digest # -- image pull policy pullPolicy: IfNotPresent From 125f69bca8c4dc3e4259967318ea432bf25cd02c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 02:51:25 +0300 Subject: [PATCH 3/5] chore(deps): update 1337kavin/piped-proxy:latest docker digest to 02065ea (#145) * chore(deps): update 1337kavin/piped-proxy:latest docker digest to 02065ea * chore: Auto-update chart metadata --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- charts/apps/piped/Chart.yaml | 4 ++-- charts/apps/piped/README.md | 4 ++-- charts/apps/piped/values.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/apps/piped/Chart.yaml b/charts/apps/piped/Chart.yaml index e6cad40..5fadc01 100644 --- a/charts/apps/piped/Chart.yaml +++ b/charts/apps/piped/Chart.yaml @@ -10,7 +10,7 @@ sources: - https://github.com/TeamPiped/piped-proxy keywords: - streaming -version: 7.3.2 +version: 7.3.3 appVersion: latest kubeVersion: ">=1.26.0-0" maintainers: @@ -28,4 +28,4 @@ dependencies: annotations: artifacthub.io/changes: |- - kind: changed - description: Updated image for `ytproxy` from latest@sha256:b2c3add82a3ab35c417abbb3539fe89e51284357ddf790ba82eb6fca3006f506 to latest@sha256:d53bcf3eb0eb944656e0606a402c26a6e2e6247b32c4200030fa72b8ad79379f + description: Updated image for `ytproxy` from latest@sha256:d53bcf3eb0eb944656e0606a402c26a6e2e6247b32c4200030fa72b8ad79379f to latest@sha256:02065eac66d6b0c6922b64f907c16f13fcff5a4933e5bbf87b77de0ebfcd92c7 diff --git a/charts/apps/piped/README.md b/charts/apps/piped/README.md index 41eb05a..b9975b0 100644 --- a/charts/apps/piped/README.md +++ b/charts/apps/piped/README.md @@ -1,6 +1,6 @@ # piped -![Version: 7.3.2](https://img.shields.io/badge/Version-7.3.2-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 7.3.3](https://img.shields.io/badge/Version-7.3.3-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) Piped is an alternative privacy-friendly YouTube frontend which is efficient by design. @@ -113,7 +113,7 @@ The following table contains an overview of available values and their descripti | ytproxy.enabled | bool | `true` | | | ytproxy.image.pullPolicy | string | `"IfNotPresent"` | image pull policy | | ytproxy.image.repository | string | `"1337kavin/piped-proxy"` | image repository | -| ytproxy.image.tag | string | `"latest@sha256:d53bcf3eb0eb944656e0606a402c26a6e2e6247b32c4200030fa72b8ad79379f"` | image tag | +| ytproxy.image.tag | string | `"latest@sha256:02065eac66d6b0c6922b64f907c16f13fcff5a4933e5bbf87b77de0ebfcd92c7"` | image tag | | ytproxy.service.main.enabled | bool | `true` | | | ytproxy.service.main.ports.http.enabled | bool | `true` | | | ytproxy.service.main.ports.http.port | int | `8080` | | diff --git a/charts/apps/piped/values.yaml b/charts/apps/piped/values.yaml index 4f84115..a518b01 100644 --- a/charts/apps/piped/values.yaml +++ b/charts/apps/piped/values.yaml @@ -142,7 +142,7 @@ ytproxy: # -- image repository repository: 1337kavin/piped-proxy # -- image tag - tag: "latest@sha256:d53bcf3eb0eb944656e0606a402c26a6e2e6247b32c4200030fa72b8ad79379f" # Manifest index / Index Digest + tag: "latest@sha256:02065eac66d6b0c6922b64f907c16f13fcff5a4933e5bbf87b77de0ebfcd92c7" # Manifest index / Index Digest # -- image pull policy pullPolicy: IfNotPresent From 9ed10e63bc098b845a6d7d68f5ce80359bd28f1e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 16:37:57 +0300 Subject: [PATCH 4/5] chore(deps): update 1337kavin/piped-proxy:latest docker digest to 9fd917b (#146) * chore(deps): update 1337kavin/piped-proxy:latest docker digest to 9fd917b * chore: Auto-update chart metadata --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- charts/apps/piped/Chart.yaml | 4 ++-- charts/apps/piped/README.md | 4 ++-- charts/apps/piped/values.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/apps/piped/Chart.yaml b/charts/apps/piped/Chart.yaml index 5fadc01..0f6514d 100644 --- a/charts/apps/piped/Chart.yaml +++ b/charts/apps/piped/Chart.yaml @@ -10,7 +10,7 @@ sources: - https://github.com/TeamPiped/piped-proxy keywords: - streaming -version: 7.3.3 +version: 7.3.4 appVersion: latest kubeVersion: ">=1.26.0-0" maintainers: @@ -28,4 +28,4 @@ dependencies: annotations: artifacthub.io/changes: |- - kind: changed - description: Updated image for `ytproxy` from latest@sha256:d53bcf3eb0eb944656e0606a402c26a6e2e6247b32c4200030fa72b8ad79379f to latest@sha256:02065eac66d6b0c6922b64f907c16f13fcff5a4933e5bbf87b77de0ebfcd92c7 + description: Updated image for `ytproxy` from latest@sha256:02065eac66d6b0c6922b64f907c16f13fcff5a4933e5bbf87b77de0ebfcd92c7 to latest@sha256:9fd917ba759dae1465415288e4d880e86b57ec385afa700fd33e13c54e61e352 diff --git a/charts/apps/piped/README.md b/charts/apps/piped/README.md index b9975b0..68d6678 100644 --- a/charts/apps/piped/README.md +++ b/charts/apps/piped/README.md @@ -1,6 +1,6 @@ # piped -![Version: 7.3.3](https://img.shields.io/badge/Version-7.3.3-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 7.3.4](https://img.shields.io/badge/Version-7.3.4-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) Piped is an alternative privacy-friendly YouTube frontend which is efficient by design. @@ -113,7 +113,7 @@ The following table contains an overview of available values and their descripti | ytproxy.enabled | bool | `true` | | | ytproxy.image.pullPolicy | string | `"IfNotPresent"` | image pull policy | | ytproxy.image.repository | string | `"1337kavin/piped-proxy"` | image repository | -| ytproxy.image.tag | string | `"latest@sha256:02065eac66d6b0c6922b64f907c16f13fcff5a4933e5bbf87b77de0ebfcd92c7"` | image tag | +| ytproxy.image.tag | string | `"latest@sha256:9fd917ba759dae1465415288e4d880e86b57ec385afa700fd33e13c54e61e352"` | image tag | | ytproxy.service.main.enabled | bool | `true` | | | ytproxy.service.main.ports.http.enabled | bool | `true` | | | ytproxy.service.main.ports.http.port | int | `8080` | | diff --git a/charts/apps/piped/values.yaml b/charts/apps/piped/values.yaml index a518b01..1f35e9e 100644 --- a/charts/apps/piped/values.yaml +++ b/charts/apps/piped/values.yaml @@ -142,7 +142,7 @@ ytproxy: # -- image repository repository: 1337kavin/piped-proxy # -- image tag - tag: "latest@sha256:02065eac66d6b0c6922b64f907c16f13fcff5a4933e5bbf87b77de0ebfcd92c7" # Manifest index / Index Digest + tag: "latest@sha256:9fd917ba759dae1465415288e4d880e86b57ec385afa700fd33e13c54e61e352" # Manifest index / Index Digest # -- image pull policy pullPolicy: IfNotPresent From 756bd33df8e7f08baed7fbd7aa965ba67f2a7520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Skyler=20M=C3=A4ntysaari?= Date: Thu, 3 Apr 2025 16:57:23 +0300 Subject: [PATCH 5/5] feat: Add reusable charts test workflow and enhance PR validation process --- .github/workflows/charts-lint.yaml | 2 +- .github/workflows/charts-test.yaml | 146 +++++++++++++++++++++++++++++ .github/workflows/pr-metadata.yaml | 77 --------------- .github/workflows/pr-validate.yaml | 98 +++++++++++++++++-- 4 files changed, 237 insertions(+), 86 deletions(-) create mode 100644 .github/workflows/charts-test.yaml delete mode 100644 .github/workflows/pr-metadata.yaml diff --git a/.github/workflows/charts-lint.yaml b/.github/workflows/charts-lint.yaml index 0c84aaa..f5588b1 100644 --- a/.github/workflows/charts-lint.yaml +++ b/.github/workflows/charts-lint.yaml @@ -58,7 +58,7 @@ jobs: - name: Set up chart-testing uses: helm/chart-testing-action@v2.7.0 - - name: Run chart-testing (install) + - name: Run chart-testing run: ct lint --config .ci/ct/ct.yaml --charts "charts/${{ matrix.chart }}" # Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7 diff --git a/.github/workflows/charts-test.yaml b/.github/workflows/charts-test.yaml new file mode 100644 index 0000000..ce411c8 --- /dev/null +++ b/.github/workflows/charts-test.yaml @@ -0,0 +1,146 @@ +name: "Charts: Test (Reusable)" + +on: + workflow_call: + inputs: + charts: + description: > + Json encoded list of Helm charts to release. + Defaults to releasing everything. + default: "[]" + required: true + type: string + helmVersion: + description: > + Helm version to use. + default: "latest" + required: false + type: string + +jobs: + install-chart: + name: Install chart + runs-on: ubuntu-22.04 + if: ${{ inputs.charts != '[]' && inputs.charts != '' }} + strategy: + matrix: + chart: ${{ fromJSON(inputs.charts) }} + k8s_version: + [ + "v1.29.13", + "v1.30.9", + "v1.31.5", + "v1.32.1", + ] + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Validate prerequisite folders + working-directory: "charts/${{ matrix.chart }}" + run: | + CHART_TYPE=$(yq '.type // "application"' Chart.yaml) + + - name: Install Kubernetes tools + uses: yokawasa/action-setup-kube-tools@v0.11.2 + with: + setup-tools: | + helmv3 + kubectl + helm: "${{ inputs.helmVersion }}" + kubectl: "${{ matrix.k8s_version }}" + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + + - name: Create k3d cluster + uses: nolar/setup-k3d-k3s@v1 + with: + version: ${{ matrix.k8s_version }} + + - name: Remove node taints + run: | + kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true + + - name: Run chart-testing (install) + working-directory: "charts/${{ matrix.chart }}" + run: | + ct install --config "$GITHUB_WORKSPACE/.ci/ct/ct.yaml" --charts . + + install_success: + needs: + - install-chart + if: ${{ !cancelled() }} + name: Install successful + runs-on: ubuntu-latest + steps: + - name: Check matrix status + if: >- + ${{ + (inputs.chartsToTest != '' && inputs.chartsToTest != '[]') && + contains(needs.*.result, 'failure') + }} + run: exit 1 + + unittest-chart: + name: Unit-test chart + runs-on: ubuntu-22.04 + if: ${{ inputs.charts != '[]' && inputs.charts != '' }} + strategy: + matrix: + chart: ${{ fromJSON(inputs.charts) }} + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Validate prerequisite folders + working-directory: "charts/${{ matrix.chart }}" + run: | + CHART_TYPE=$(yq '.type // "application"' Chart.yaml) + + - name: Install Kubernetes tools + uses: yokawasa/action-setup-kube-tools@v0.11.2 + with: + setup-tools: | + helmv3 + helm: "${{ inputs.helmVersion }}" + +# - name: Dereference JSON schema +# uses: bjw-s/helm-charts-actions/dereference-json-schema@main +# with: +# schemaFile: "charts/${{ matrix.chart }}/values.schema.json" +# outputFile: "charts/${{ matrix.chart }}/values.schema.json" +# allowFileNotFound: true + + - name: Run tests + working-directory: "charts/${{ matrix.chart }}" + run: | + if [[ ! -d "unittests" ]]; then + echo "No unit tests found for chart ${{ matrix.chart }}" + exit 0 + fi + + helm plugin install https://github.com/helm-unittest/helm-unittest.git + helm dep update + helm unittest -f "unittests/**/*_test.yaml" . + + unittest_success: + needs: + - unittest-chart + if: ${{ !cancelled() }} + name: Unittest successful + runs-on: ubuntu-latest + steps: + - name: Check matrix status + if: >- + ${{ + (inputs.chartsToTest != '' && inputs.chartsToTest != '[]') && + contains(needs.*.result, 'failure') + }} + run: exit 1 \ No newline at end of file diff --git a/.github/workflows/pr-metadata.yaml b/.github/workflows/pr-metadata.yaml deleted file mode 100644 index a40b40b..0000000 --- a/.github/workflows/pr-metadata.yaml +++ /dev/null @@ -1,77 +0,0 @@ -name: "Pull Request: Get metadata" - -on: - workflow_call: - outputs: - isRenovatePR: - description: "Is the PR coming from Renovate?" - value: ${{ jobs.pr-metadata.outputs.isRenovatePR }} - isFork: - description: "Is the PR coming from a forked repo?" - value: ${{ jobs.pr-metadata.outputs.isFork }} - addedOrModifiedFilesDetected: - description: "Does the PR contain any changes?" - value: ${{ jobs.pr-changes.outputs.addedOrModifiedFilesDetected }} - addedOrModifiedFiles: - description: "A list of the files changed in this PR" - value: ${{ jobs.pr-changes.outputs.addedOrModifiedFiles }} - addedOrModifiedCharts: - description: "A list of the charts changed in this PR" - value: ${{ jobs.pr-changes.outputs.addedOrModifiedCharts }} - chartsToLint: - value: ${{ jobs.pr-changes.outputs.chartsToLint }} - chartsToInstall: - value: ${{ jobs.pr-changes.outputs.chartsToInstall }} - -jobs: - pr-metadata: - name: Collect PR metadata - runs-on: ubuntu-latest - outputs: - isRenovatePR: ${{ startsWith(steps.branch-name.outputs.current_branch, 'renovate/') }} - isFork: ${{ github.event.pull_request.head.repo.full_name != github.repository }} - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6.5 - - - name: Save PR data to file - env: - PR_NUMBER: ${{ github.event.number }} - run: | - echo $PR_NUMBER > pr_number.txt - - - name: Store pr data in artifact - uses: actions/upload-artifact@v4 - with: - name: pr_metadata - path: ./pr_number.txt - retention-days: 5 - - pr-changes: - name: Collect PR changes - runs-on: ubuntu-latest - outputs: - addedOrModifiedFilesDetected: ${{ steps.changed-files.outputs.allAddedOrModified }} - addedOrModifiedFiles: ${{ steps.changed-files.outputs.allAddedOrModified_files }} - addedOrModifiedCharts: ${{ steps.changed-charts.outputs.charts }} - chartsToLint: ${{ steps.changed-charts.outputs.chartsToLint }} - chartsToInstall: ${{ steps.changed-charts.outputs.chartsToInstall }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Collect changed files - uses: dorny/paths-filter@v3 - id: changed-files - with: - list-files: json - filters: | - allAddedOrModified: - - added|modified: '**' - - - name: Collect changed charts - uses: bjw-s-labs/helm-charts-actions/collect-charts@2025.2.0 - id: changed-charts diff --git a/.github/workflows/pr-validate.yaml b/.github/workflows/pr-validate.yaml index 7e9f1a1..07aa539 100644 --- a/.github/workflows/pr-validate.yaml +++ b/.github/workflows/pr-validate.yaml @@ -2,6 +2,11 @@ name: "Pull Request: Validate" on: pull_request: + types: + - opened + - reopened + - ready_for_review + - synchronize workflow_dispatch: concurrency: @@ -9,23 +14,100 @@ concurrency: cancel-in-progress: true jobs: - pr-metadata: - uses: ./.github/workflows/pr-metadata.yaml + prepare: + name: Prepare data required for workflow + runs-on: ubuntu-22.04 + outputs: + isRenovatePR: ${{ startsWith(steps.branch-name.outputs.current_branch, 'renovate/') }} + repoConfiguration: ${{ steps.repo-config.outputs.config }} + addedOrModifiedFiles: ${{ steps.added-modified-files.outputs.all_changed_files }} + chartsToLint: ${{ steps.charts-to-lint.outputs.filteredCharts }} + chartsToInstall: ${{ steps.charts-to-install.outputs.filteredCharts }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Grab repository configuration + id: repo-config + shell: bash + run: | + echo "config=$(yq '.' '.ci/repo-config.yaml' -o json -I=0)" >> "$GITHUB_OUTPUT" + + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v6.5 + + - name: Get all added or modified files + id: added-modified-files + uses: tj-actions/changed-files@v45 + + - name: Get changed charts + id: changed-charts + uses: tj-actions/changed-files@v45 + with: + matrix: true + path: charts + dir_names: true + dir_names_max_depth: 2 + + - name: Determine charts to lint + id: charts-to-lint + uses: actions/github-script@v7 + with: + script: | + var changedCharts = ${{ steps.changed-charts.outputs.all_changed_files }}; + var chartsToFilter = ${{ toJSON(fromJSON(steps.repo-config.outputs.config).excluded-charts-lint) }}; + let filteredCharts = changedCharts.filter(item => chartsToFilter.indexOf(item) < 0); + core.setOutput("filteredCharts", filteredCharts); + + - name: Determine charts to install + id: charts-to-install + uses: actions/github-script@v7 + with: + script: | + var changedCharts = ${{ steps.changed-charts.outputs.all_changed_files }}; + var chartsToFilter = ${{ toJSON(fromJSON(steps.repo-config.outputs.config).excluded-charts-install) }}; + let filteredCharts = changedCharts.filter(item => chartsToFilter.indexOf(item) < 0); + core.setOutput("filteredCharts", filteredCharts); + + pre-commit-check: + name: Perform Pre-Commit check + runs-on: ubuntu-22.04 + needs: + - prepare + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run against changes + uses: pre-commit/action@v3.0.1 + with: + extra_args: --files ${{ needs.prepare.outputs.addedOrModifiedFiles }} --config .ci/pre-commit/config.yaml charts-changelog: uses: ./.github/workflows/charts-changelog.yaml needs: - - pr-metadata + - prepare with: - isRenovatePR: ${{ needs.pr-metadata.outputs.isRenovatePR }} - modifiedCharts: ${{ needs.pr-metadata.outputs.addedOrModifiedCharts }} + isRenovatePR: ${{ needs.prepare.outputs.isRenovatePR }} + modifiedCharts: ${{ needs.prepare.outputs.addedOrModifiedCharts }} charts-lint: uses: ./.github/workflows/charts-lint.yaml needs: - - pr-metadata + - prepare - charts-changelog with: checkoutCommit: ${{ github.sha }} - chartsToLint: ${{ needs.pr-metadata.outputs.chartsToLint }} - isRenovatePR: ${{ needs.pr-metadata.outputs.isRenovatePR }} + chartsToLint: ${{ needs.prepare.outputs.chartsToLint }} + isRenovatePR: ${{ needs.prepare.outputs.isRenovatePR }} + + charts-test: + name: Test charts + uses: ./.github/workflows/charts-test.yaml + needs: + - prepare + with: + charts: ${{ needs.prepare.outputs.chartsToInstall }}