Skip to content

Commit

Permalink
Add pull request tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GMartinez-Sisti committed Mar 10, 2021
1 parent 55098e2 commit 9f472dc
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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)
run: |
envsubst < charts/cga-proxy/ci/test-values.yaml.tpl > charts/cga-proxy/ci/test-values.yaml
cat charts/cga-proxy/ci/test-values.yaml
ct install --config ct.yaml
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Chart dependencies
/charts/*/charts

# Chart testing
charts/cga-proxy/ci/test-values.yaml
10 changes: 10 additions & 0 deletions charts/cga-proxy/ci/test-values.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
orchestrator:
enrollmentToken:
newSecret:
# Replaced by the CI when testing
value: "$CI_CGA_PROXY_TOKEN"
highAvailability:
enabled: true

redis-ha:
replicas: 1
6 changes: 6 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
target-branch: main
chart-dirs:
- charts
chart-repos:
dandydeveloper=https://dandydeveloper.github.io/charts
validate-maintainers: false

0 comments on commit 9f472dc

Please sign in to comment.