Commit 40f5eac8 authored by Jean-Philippe Evrard's avatar Jean-Philippe Evrard
Browse files

Simplify action code

There are lots of duplicated code in this workflow.
This fixes it by making a unique job with parameters. The
matrix buys us the parallelisation and the fail-fast.
parent 1b54c4bc
......@@ -5,33 +5,20 @@ on:
pull_request:
paths:
- "charts/**"
jobs:
lint-chart:
name: Lint helm chart
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- uses: actions/setup-python@v2
with:
python-version: 3.7
# Helm is already present in github actions, so do not re-install it
- name: Setup chart testing
uses: helm/chart-testing-action@v2.0.1
- name: Run chart testing
run: ct lint --config .github/ct.yaml
# We create two jobs instead of one to make those parallel.
# GH should cancel the rest of the workflow if lint is failing.
# We create two jobs (with a matrix) instead of one to make those parallel.
# We don't need to conditionally check if something has changed, due to github actions
# tackling that for us.
# Fail-fast ensures that if one of those matrix job fail, the other one gets cancelled.
test-chart:
name: Install helm chart
name: Test helm chart
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
test-action:
- lint
- install
steps:
- name: Checkout
uses: actions/checkout@v2
......@@ -48,6 +35,7 @@ jobs:
- name: Create default kind cluster
uses: helm/kind-action@v1.1.0
if: ${{ matrix.test-action == 'install' }}
- name: Install chart with chart-testing
run: ct install
- name: Run chart tests
run: ct ${{ matrix.test-action }} --config .github/ct.yaml
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment