mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
ci: 🧠
This commit is contained in:
parent
bb122b930c
commit
c649d44c21
3 changed files with 71 additions and 54 deletions
8
.github/workflows/charts-lint.yaml
vendored
8
.github/workflows/charts-lint.yaml
vendored
|
@ -10,6 +10,9 @@ on:
|
|||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
HELM_VERSION: 3.9.2
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint charts
|
||||
|
@ -26,10 +29,7 @@ jobs:
|
|||
with:
|
||||
setup-tools: |
|
||||
helmv3
|
||||
helm: "3.8.0"
|
||||
|
||||
- name: Install Helm
|
||||
uses: Azure/setup-helm@v3.3
|
||||
helm: "${{ env.HELM_VERSION }}"
|
||||
|
||||
- name: Set up chart-testing
|
||||
uses: helm/chart-testing-action@v2.2.1
|
||||
|
|
17
.github/workflows/charts-release.yaml
vendored
17
.github/workflows/charts-release.yaml
vendored
|
@ -15,6 +15,9 @@ on:
|
|||
paths:
|
||||
- "charts/**"
|
||||
|
||||
env:
|
||||
HELM_VERSION: 3.9.2
|
||||
|
||||
jobs:
|
||||
release-charts:
|
||||
name: Release charts
|
||||
|
@ -31,7 +34,7 @@ jobs:
|
|||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ steps.get-app-token.outputs.token }}
|
||||
path: 'src'
|
||||
path: "src"
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Collect changes
|
||||
|
@ -61,14 +64,16 @@ jobs:
|
|||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ steps.get-app-token.outputs.token }}
|
||||
path: 'dest'
|
||||
ref: 'gh-pages'
|
||||
path: "dest"
|
||||
ref: "gh-pages"
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Helm
|
||||
uses: Azure/setup-helm@v3.3
|
||||
- name: Install Kubernetes tools
|
||||
uses: yokawasa/action-setup-kube-tools@v0.8.2
|
||||
with:
|
||||
token: ${{ steps.get-app-token.outputs.token }}
|
||||
setup-tools: |
|
||||
helmv3
|
||||
helm: "${{ env.HELM_VERSION }}"
|
||||
|
||||
- name: Package Helm Charts
|
||||
shell: bash
|
||||
|
|
100
.github/workflows/charts-test.yaml
vendored
100
.github/workflows/charts-test.yaml
vendored
|
@ -10,44 +10,13 @@ on:
|
|||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
HELM_VERSION: 3.9.2
|
||||
|
||||
jobs:
|
||||
# unit-test:
|
||||
# name: Run unit tests
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v3
|
||||
# with:
|
||||
# fetch-depth: 0
|
||||
# ref: ${{ inputs.checkoutCommit }}
|
||||
|
||||
# - name: Install Kubernetes tools
|
||||
# uses: yokawasa/action-setup-kube-tools@v0.8.2
|
||||
# with:
|
||||
# setup-tools: |
|
||||
# helmv3
|
||||
# helm: "3.8.0"
|
||||
|
||||
# - name: Install Ruby
|
||||
# uses: ruby/setup-ruby@v1
|
||||
# with:
|
||||
# ruby-version: 2.7
|
||||
|
||||
# - name: Install dependencies
|
||||
# env:
|
||||
# RUBYJQ_USE_SYSTEM_LIBRARIES: 1
|
||||
# run: |
|
||||
# sudo apt-get update
|
||||
# sudo apt-get install libjq-dev
|
||||
# bundle install
|
||||
|
||||
# - name: Run tests
|
||||
# run: |
|
||||
# bundle exec m -r ./test/
|
||||
|
||||
generate-install-matrix:
|
||||
generate-test-matrix:
|
||||
name: Generate matrix for install
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
matrix: |
|
||||
{
|
||||
|
@ -79,13 +48,13 @@ jobs:
|
|||
|
||||
install-charts:
|
||||
needs:
|
||||
- generate-install-matrix
|
||||
if: needs.generate-install-matrix.outputs.detected == 'true'
|
||||
- generate-test-matrix
|
||||
if: needs.generate-test-matrix.outputs.detected == 'true'
|
||||
name: Install charts
|
||||
strategy:
|
||||
matrix: ${{ fromJson(needs.generate-install-matrix.outputs.matrix) }}
|
||||
matrix: ${{ fromJson(needs.generate-test-matrix.outputs.matrix) }}
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
@ -99,7 +68,7 @@ jobs:
|
|||
setup-tools: |
|
||||
helmv3
|
||||
kubectl
|
||||
helm: "3.6.3"
|
||||
helm: "${{ env.HELM_VERSION }}"
|
||||
kubectl: "${{ matrix.k8s_version }}"
|
||||
|
||||
- uses: actions/setup-python@v4
|
||||
|
@ -124,13 +93,56 @@ jobs:
|
|||
# Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7
|
||||
install_success:
|
||||
needs:
|
||||
- generate-install-matrix
|
||||
- generate-test-matrix
|
||||
- install-charts
|
||||
if: |
|
||||
always()
|
||||
name: Install successful
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Check install matrix status
|
||||
if: ${{ (needs.generate-install-matrix.outputs.detected == 'true') && (needs.install-charts.result != 'success') }}
|
||||
if: ${{ (needs.generate-test-matrix.outputs.detected == 'true') && (needs.install-charts.result != 'success') }}
|
||||
run: exit 1
|
||||
|
||||
unittest:
|
||||
name: Run unit tests
|
||||
runs-on: ubuntu-20.04
|
||||
needs:
|
||||
- generate-test-matrix
|
||||
if: needs.generate-test-matrix.outputs.detected == 'true'
|
||||
strategy:
|
||||
matrix: ${{ fromJson(needs.generate-test-matrix.outputs.matrix) }}
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ inputs.checkoutCommit }}
|
||||
|
||||
- name: Install Kubernetes tools
|
||||
uses: yokawasa/action-setup-kube-tools@v0.8.2
|
||||
with:
|
||||
setup-tools: |
|
||||
helmv3
|
||||
helm: "${{ env.HELM_VERSION }}"
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
helm plugin install https://github.com/vbehar/helm3-unittest --version v1.0.16
|
||||
cd ${{ matrix.chart }}
|
||||
helm unittest -f "tests/**/*_test.yaml" .
|
||||
|
||||
# Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7
|
||||
unittest_success:
|
||||
needs:
|
||||
- generate-test-matrix
|
||||
- unittest
|
||||
if: |
|
||||
always()
|
||||
name: Unittest successful
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Check unittest matrix status
|
||||
if: ${{ (needs.generate-test-matrix.outputs.detected == 'true') && (needs.unittest.result != 'success') }}
|
||||
run: exit 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue