-
Notifications
You must be signed in to change notification settings - Fork 15
82 lines (72 loc) · 2.73 KB
/
portal-chart-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Portal Lint and Test Chart
on:
push:
paths:
- 'charts/portal/**'
branches: [main, dev, release-candidate]
pull_request:
paths:
- 'charts/portal/**'
workflow_dispatch:
inputs:
node_image:
description: 'kindest/node image for k8s kind cluster'
# k8s version from 3.1 release
default: 'kindest/node:v1.24.6'
required: false
type: string
upgrade_from:
description: 'portal chart version to upgrade from'
# portal version from 3.1 release
default: '1.3.0'
required: false
type: string
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Kubernetes KinD Cluster
uses: container-tools/kind-action@v2
with:
version: v0.19.0
node_image: ${{ github.event.inputs.node_image || 'kindest/node:v1.24.6' }}
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.10.3
# Setup python as a prerequisite for chart linting
- uses: actions/setup-python@v4
with:
python-version: '3.9'
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
# run chart linting
- name: Run chart-testing (lint)
run: ct lint --charts charts/portal --config charts/chart-testing-config.yaml
- name: Run helm install
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev
helm install portal charts/portal --namespace install --create-namespace
if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'
# Upgrade the released portal chart version with the locally available chart
- name: Run helm upgrade
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev
helm install portal tractusx-dev/portal --version ${{ github.event.inputs.upgrade_from || '1.3.0' }} --namespace upgrade --create-namespace
helm dependency update charts/portal
helm upgrade portal charts/portal --namespace upgrade
if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'