charts/.github/workflows/charts-lint-test.yaml
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 4b23411778
[common] Transfer to separate repo (#656)
* [common] Transfer to separate repo

* Remove common unittests

* Use k3d instead of kind

* Bump all charts

* Skip uninstallable charts

* [alertmanager-bot] Disable probes

* Skip uninstallable charts
2021-03-12 07:59:14 -05:00

112 lines
2.6 KiB
YAML

name: "Charts: Lint and test"
on:
pull_request:
paths:
- 'charts/**'
- '!charts/**/README.md'
- '!charts/**/README.md.gotmpl'
- '!charts/**/README_CHANGELOG.md.gotmpl'
- '!charts/**/README_CONFIG.md.gotmpl'
jobs:
lint:
if: "!contains(github.event.head_commit.message, '[ci-skip]')"
runs-on: ubuntu-20.04
outputs:
changed: ${{ steps.list-changed.outputs.changed }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install 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 .github/ct-lint.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
id: lint
run: ct lint --config .github/ct-lint.yaml
if: steps.list-changed.outputs.changed == 'true'
unittest:
if: "!contains(github.event.head_commit.message, '[ci-skip]')"
runs-on: ubuntu-20.04
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Dev tools
run: sudo apt-get update && sudo apt-get install -y jq libjq-dev
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install dependencies
run: |
export RUBYJQ_USE_SYSTEM_LIBRARIES=1
bundle install
- name: Run tests
run: |
bundle exec m -r test/charts
install:
if: "!contains(github.event.head_commit.message, '[ci-skip]')"
runs-on: ubuntu-20.04
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install 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: Create k3d cluster
uses: nolar/setup-k3d-k3s@v1
with:
version: v1.19
if: needs.lint.outputs.changed == 'true'
- name: Run chart-testing (install)
run: ct install --config .github/ct-install.yaml
if: needs.lint.outputs.changed == 'true'