Files
truecharts/.github/workflows/catalog-test.yaml
TrueCharts Bot 777d0645fd chore(deps): update github-actions by renovate (major) (#18247)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/checkout](https://togithub.com/actions/checkout) | action |
major | `v3` -> `v4` |
| [dorny/paths-filter](https://togithub.com/dorny/paths-filter) | action
| major | `v2` -> `v3` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>actions/checkout (actions/checkout)</summary>

###
[`v4`](https://togithub.com/actions/checkout/blob/HEAD/CHANGELOG.md#v410)

[Compare Source](https://togithub.com/actions/checkout/compare/v3...v4)

- [Add support for partial checkout
filters](https://togithub.com/actions/checkout/pull/1396)

</details>

<details>
<summary>dorny/paths-filter (dorny/paths-filter)</summary>

###
[`v3`](https://togithub.com/dorny/paths-filter/blob/HEAD/CHANGELOG.md#v301)

[Compare
Source](https://togithub.com/dorny/paths-filter/compare/v1...v3)

- [Compare base and ref when token is
empty](https://togithub.com/dorny/paths-filter/pull/133)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOTEuMSIsInVwZGF0ZWRJblZlciI6IjM3LjIwMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->

Signed-off-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Co-authored-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
2024-02-21 17:39:52 +01:00

101 lines
3.4 KiB
YAML

name: "SCALE: catalog-tests"
on:
workflow_call:
inputs:
checkoutCommit:
required: true
type: string
chartChangesDetected:
required: true
type: string
modifiedCharts:
required: true
type: string
jobs:
catalog-tests:
name: Test SCALE Catalog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
name: Checkout
with:
fetch-depth: 100
ref: ${{ inputs.checkoutCommit }}
- name: Setting repo parent dir as safe safe.directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
name: Checkout-validate
with:
fetch-depth: 1
repository: truecharts/catalog_validation
path: .catalog_validation
- name: install catalog_validation
shell: bash
run: |
cd .catalog_validation
pip install -r requirements.txt
pip install -U --no-cache-dir .
cd -
- 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: Collect changes (branch-based)
id: list-changed
if: inputs.chartChangesDetected == 'true'
shell: bash
run: |
CHARTS="${{ inputs.modifiedCharts }}"
echo "Modified Charts: ${CHARTS}"
EXCLUDED_JSON=$(go-yq eval -o=json '.excluded-charts // []' .github/ct-lint.yaml)
CHARTS_JSON=$(echo "${CHARTS}" | jq --raw-input '.' | jq --compact-output --slurp '.')
OUTPUT_JSON=$(echo "{\"excluded\": ${EXCLUDED_JSON}, \"all\": ${CHARTS_JSON}}" | jq --compact-output '.all-.excluded')
echo CHANGED_CHARTS=${OUTPUT_JSON} >> "$GITHUB_OUTPUT"
if [[ $(echo ${OUTPUT_JSON} | jq --compact-output '. | length') -gt 0 ]]; then
echo "detected=true" >> "$GITHUB_OUTPUT"
fi
- name: Fetch and Verify dependencies
shell: bash
if: steps.list-changed.outputs.detected == 'true'
env:
charts_path: "./"
run: |
CHANGED=$(echo '${{ steps.list-changed.outputs.CHANGED_CHARTS }}' | jq --raw-output '.[]')
./charttool deps ${CHANGED}
- name: Build Catalog
shell: bash
if: steps.list-changed.outputs.detected == 'true'
env:
charts_path: "./"
run: |
CHANGED=$(echo '${{ steps.list-changed.outputs.CHANGED_CHARTS }}' | jq --raw-output '.[]')
./charttool buildSCALE ${CHANGED}
## 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: Test Catalog
shell: bash
if: steps.list-changed.outputs.detected == 'true'
run: |
echo "Starting Catalog Validation"
python3 .catalog_validation/catalog_validation/scripts/catalog_validate.py validate --path "${PWD}/catalog" --ignore-catalog-json