Files
library-charts/.github/workflows/common.test.yaml
2022-04-22 21:28:05 +02:00

79 lines
2.2 KiB
YAML

name: "common: Tests"
on:
pull_request:
branches:
- '**'
tags-ignore:
- '**'
paths:
- 'charts/**'
- 'helper-charts/**'
- 'tests/**'
- '.github/workflows/common.test.yaml'
- '.github/ct-install.yaml'
- '.github/ct-lint.yaml'
jobs:
unit-and-lint:
name: Unit and Lint tests
runs-on: ubuntu-latest
container:
image: tccr.io/truecharts/devcontainer:v2.2.1@sha256:4ace13c049bf00f85c63e0070f86b71656a7c3b2113aa3e21c3107f3d1f7bf87
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
name: Checkout
with:
fetch-depth: 100
- name: Run chart-testing (lint)
run: ct lint --config .github/ct-lint.yaml --charts 'helper-charts/common-test'
- name: Run common unit tests
run: |
bundle exec m -r tests
run-tests:
name: Run tests
runs-on: ubuntu-latest
needs: [unit-and-lint]
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
name: Checkout
with:
fetch-depth: 100
- name: Install Helm
if: ${{ matrix.app != '.gitkee' }}
uses: azure/setup-helm@18bc76811624f360dbd7f18c2d4ecb32c7b87bab # renovate: tag=v1
with:
version: v3.7.1
- uses: actions/setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6 # tag=v3
if: ${{ matrix.app != '.gitkee' }}
with:
python-version: 3.7
- name: Set up chart-testing
if: ${{ matrix.app != '.gitkee' }}
uses: helm/chart-testing-action@dae259e86a35ff09145c0805e2d7dd3f7207064a # tag=v2.2.1
##
# Chart-Testing Section
##
- uses: actions/setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6 # tag=v3
if: ${{ matrix.app != '.gitkee' }}
with:
python-version: 3.7
- name: Create k3d cluster
uses: nolar/setup-k3d-k3s@v1
with:
version: v1.22.4+k3s1
- name: Run chart-testing (install)
run: find ./ -type f -name *.yaml -exec sed -i 's/tccr.io/ghcr.io/gI' {} \; && ct install --config .github/ct-install.yaml --charts 'helper-charts/common-test'