diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml new file mode 100644 index 0000000..2dd538e --- /dev/null +++ b/.github/workflows/lint-test.yml @@ -0,0 +1,46 @@ +name: Lint and Test Charts + +on: pull_request + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.4.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.0.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --config ct.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Run chart-testing (lint) + run: ct lint --config ct.yaml + + - name: Create kind cluster + uses: helm/kind-action@v1.0.0 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + env: + PROXY_TOKEN: ${{ secrets.CI_CGA_PROXY_TOKEN }} + run: | + envsubst < charts/cga-proxy/ci/test-values.yaml.tpl > charts/cga-proxy/ci/test-values.yaml + ct install --config ct.yaml diff --git a/.gitignore b/.gitignore index 24c1606..6d06d84 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ # Chart dependencies /charts/*/charts + +# Chart testing +charts/cga-proxy/ci/test-values.yaml diff --git a/charts/cga-proxy/ci/test-values.yaml.tpl b/charts/cga-proxy/ci/test-values.yaml.tpl new file mode 100644 index 0000000..a373bdf --- /dev/null +++ b/charts/cga-proxy/ci/test-values.yaml.tpl @@ -0,0 +1,7 @@ +orchestrator: + enrollmentToken: + newSecret: + # Replaced by the CI when testing + value: "$PROXY_TOKEN" + highAvailability: + enabled: true diff --git a/ct.yaml b/ct.yaml new file mode 100644 index 0000000..7de8898 --- /dev/null +++ b/ct.yaml @@ -0,0 +1,6 @@ +target-branch: main +chart-dirs: + - charts +chart-repos: + dandydeveloper=https://dandydeveloper.github.io/charts +validate-maintainers: false