Skip to content

Commit

Permalink
[repo] update CI for Helm 3
Browse files Browse the repository at this point in the history
Upgrade CI actions for use with Helm 3.

The chart-testing action changed significantly in its 2.0.0 release and
the workflow is almost completely new. The revision is mostly their
current example:
https://github.com/helm/chart-testing-action/tree/v2.0.1#upgrading-from-v1xx

These changes no longer use the config files and exclude the original
timeout override. It doesn't look like we should need that since the
current default is longer than the old override (300s vs 200s).
  • Loading branch information
Travis Raines committed Mar 4, 2021
1 parent 6129d11 commit 0b0405d
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 51 deletions.
52 changes: 30 additions & 22 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,38 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Fetch history
run: git fetch --prune --unshallow
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0

- name: Run chart-testing (lint)
id: lint
uses: helm/[email protected]
- uses: actions/setup-python@v2
with:
command: lint
config: ct-main.yaml
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --chart-repos bitnami=https://charts.bitnami.com/bitnami --remote origin

- name: Create kind cluster
uses: helm/[email protected]
with:
install_local_path_provisioner: true
if: steps.lint.outputs.changed == 'true'
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
uses: helm/[email protected]
with:
command: install
config: ct-main.yaml
run: ct install
release:
needs: lint-test
runs-on: ubuntu-latest
Expand All @@ -49,18 +59,16 @@ jobs:
git config user.email "[email protected]"
# See https://github.com/helm/chart-releaser-action/issues/6
- name: Install Helm
run: |
curl -sSLo get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get
chmod 700 get_helm.sh
./get_helm.sh
helm init --client-only
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0

- name: Add dependency chart repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.0.0-alpha.2
uses: helm/chart-releaser-action@v1.1.0
env:
CR_TOKEN: "${{ secrets.CR_TOKEN }}"
39 changes: 26 additions & 13 deletions .github/workflows/non-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches-ignore:
- 'main'
- 'kong-1.x'
pull_request:
branches:
- '**'
Expand All @@ -14,23 +15,35 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Fetch history
run: git fetch --prune --unshallow
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0

- name: Run chart-testing (lint)
id: lint
uses: helm/[email protected]
- uses: actions/setup-python@v2
with:
command: lint
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --chart-repos bitnami=https://charts.bitnami.com/bitnami --check-version-increment false --remote origin

- name: Create kind cluster
uses: helm/[email protected]
with:
install_local_path_provisioner: true
if: steps.lint.outputs.changed == 'true'
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
uses: helm/[email protected]
with:
command: install
run: ct install
8 changes: 0 additions & 8 deletions ct-main.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions ct.yaml

This file was deleted.

0 comments on commit 0b0405d

Please sign in to comment.