2021-09-28 22:11:52 +00:00
|
|
|
name: "common: Tests"
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
tags-ignore:
|
|
|
|
- '**'
|
|
|
|
paths:
|
|
|
|
- 'charts/library/**'
|
2021-09-28 22:56:39 +00:00
|
|
|
- 'tests/**'
|
2021-09-28 22:11:52 +00:00
|
|
|
- '.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:
|
2021-12-04 17:35:37 +00:00
|
|
|
image: tccr.io/truecharts/devcontainer:v2.2.1
|
2021-09-28 22:11:52 +00:00
|
|
|
steps:
|
|
|
|
- name: Cache helm repo cache
|
|
|
|
id: cache
|
2021-12-10 15:32:28 +00:00
|
|
|
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # renovate: tag=v2
|
2021-09-28 22:11:52 +00:00
|
|
|
with:
|
|
|
|
key: helmrepocache-${{ github.sha }}
|
|
|
|
path: |
|
|
|
|
~/.cache/helm/repository
|
|
|
|
~/.config/helm/repositories.yaml
|
|
|
|
|
2022-03-02 10:52:19 +00:00
|
|
|
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3
|
2021-09-28 22:11:52 +00:00
|
|
|
name: Checkout
|
|
|
|
with:
|
|
|
|
fetch-depth: 100
|
|
|
|
|
|
|
|
- name: update helm repo cache
|
|
|
|
run: |
|
|
|
|
helm repo add truecharts https://truecharts.org
|
|
|
|
helm repo add bitnami https://charts.bitnami.com/bitnami
|
2021-11-10 16:35:49 +00:00
|
|
|
helm repo add metallb https://metallb.github.io/metallb
|
2021-11-21 20:52:23 +00:00
|
|
|
helm repo add grafana https://grafana.github.io/helm-charts
|
2021-11-21 21:37:45 +00:00
|
|
|
helm repo add prometheus https://prometheus-community.github.io/helm-charts
|
2022-01-12 20:29:12 +00:00
|
|
|
helm repo add amd-gpu-helm https://radeonopencompute.github.io/k8s-device-plugin/
|
2021-09-28 22:11:52 +00:00
|
|
|
helm repo update
|
|
|
|
|
|
|
|
- name: Run chart-testing (lint)
|
|
|
|
run: ct lint --config .github/ct-lint.yaml --charts 'charts/library/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:
|
|
|
|
- name: Cache helm repo cache
|
|
|
|
id: cache
|
2021-12-10 15:32:28 +00:00
|
|
|
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # renovate: tag=v2
|
2021-09-28 22:11:52 +00:00
|
|
|
with:
|
|
|
|
key: helmrepocache-${{ github.sha }}
|
|
|
|
path: |
|
|
|
|
~/.cache/helm/repository
|
|
|
|
~/.config/helm/repositories.yaml
|
|
|
|
|
2022-03-02 10:52:19 +00:00
|
|
|
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3
|
2021-09-28 22:11:52 +00:00
|
|
|
name: Checkout
|
|
|
|
with:
|
|
|
|
fetch-depth: 100
|
|
|
|
|
|
|
|
- name: Install Helm
|
|
|
|
if: ${{ matrix.app != '.gitkee' }}
|
2021-12-10 15:32:28 +00:00
|
|
|
uses: azure/setup-helm@18bc76811624f360dbd7f18c2d4ecb32c7b87bab # renovate: tag=v1
|
2021-09-28 22:11:52 +00:00
|
|
|
with:
|
2021-12-05 11:08:10 +00:00
|
|
|
version: v3.7.1
|
2021-09-28 22:11:52 +00:00
|
|
|
|
|
|
|
- name: update helm repo cache
|
|
|
|
run: |
|
|
|
|
helm repo add truecharts https://truecharts.org
|
|
|
|
helm repo add bitnami https://charts.bitnami.com/bitnami
|
2021-11-10 16:35:49 +00:00
|
|
|
helm repo add metallb https://metallb.github.io/metallb
|
2021-11-21 21:37:45 +00:00
|
|
|
helm repo add prometheus https://prometheus-community.github.io/helm-charts
|
2022-01-12 20:29:12 +00:00
|
|
|
helm repo add amd-gpu-helm https://radeonopencompute.github.io/k8s-device-plugin/
|
2021-09-28 22:11:52 +00:00
|
|
|
helm repo update
|
|
|
|
|
2022-02-28 15:10:22 +00:00
|
|
|
- uses: actions/setup-python@0ebf233433c08fb9061af664d501c3f3ff0e9e20 # tag=v3
|
2021-09-28 22:11:52 +00:00
|
|
|
if: ${{ matrix.app != '.gitkee' }}
|
|
|
|
with:
|
|
|
|
python-version: 3.7
|
|
|
|
|
|
|
|
- name: Set up chart-testing
|
|
|
|
if: ${{ matrix.app != '.gitkee' }}
|
2022-03-14 13:20:40 +00:00
|
|
|
uses: helm/chart-testing-action@dae259e86a35ff09145c0805e2d7dd3f7207064a # tag=v2.2.1
|
2021-09-28 22:11:52 +00:00
|
|
|
##
|
|
|
|
# Chart-Testing Section
|
|
|
|
##
|
|
|
|
|
2022-02-28 15:10:22 +00:00
|
|
|
- uses: actions/setup-python@0ebf233433c08fb9061af664d501c3f3ff0e9e20 # tag=v3
|
2021-09-28 22:11:52 +00:00
|
|
|
if: ${{ matrix.app != '.gitkee' }}
|
|
|
|
with:
|
|
|
|
python-version: 3.7
|
|
|
|
|
|
|
|
- name: Create k3d cluster
|
|
|
|
uses: nolar/setup-k3d-k3s@v1
|
|
|
|
with:
|
2021-12-05 10:55:41 +00:00
|
|
|
version: v1.22.4+k3s1
|
2021-09-28 22:11:52 +00:00
|
|
|
|
|
|
|
- name: Run chart-testing (install)
|
2021-12-05 10:55:41 +00:00
|
|
|
run: find ./ -type f -name *.yaml -exec sed -i 's/tccr.io/ghcr.io/gI' {} \; && ct install --config .github/ct-install.yaml --charts 'charts/library/common-test'
|