diff --git a/.github/workflows/catalog-template-test.yaml b/.github/workflows/catalog-template-test.yaml new file mode 100644 index 00000000000..9871d41ab58 --- /dev/null +++ b/.github/workflows/catalog-template-test.yaml @@ -0,0 +1,69 @@ +name: "SCALE: catalog-tests" + +on: + pull_request: + paths: + - '.github/workflows/catalog-template-test.yaml' + - '.github/workflows/catalog-test.yaml' + - 'templates/*' + - 'templates/**' + - 'templates/**/*' +jobs: + catalog-tests: + name: Test SCALE Catalog Templates + 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@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 + 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: 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 ${PWD}/charts + + - name: Checkout + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 + with: + repository: truecharts/catalog + path: catalog + + - name: Build Complete 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 ${PWD}/charts + + - name: Test Complete 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