forked from wasmCloud/wasmCloud
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (85 loc) · 3.38 KB
/
benchmark-chart.yml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Benchmark Chart
env:
HELM_VERSION: v3.16.3
CHART_TESTING_NAMESPACE: chart-testing
on:
push:
tags:
- 'benchmark-chart-v[0-9].[0-9]+.[0-9]+'
pull_request:
branches: [main]
paths:
- 'charts/benchmark/**'
- '.github/workflows/benchmark-chart.yml'
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Shallow fetch the latest main so the chart-testing action can compare
- name: Shallow fetch main
run: git fetch origin main --depth=1
- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: ${{ env.HELM_VERSION }}
# Used by helm chart-testing below
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.12.2'
- name: Set up chart-testing
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
with:
version: v3.12.0
yamllint_version: 1.35.1
yamale_version: 5.0.0
- name: Create kind cluster
uses: helm/kind-action@ae94020eaf628e9b9b9f341a10cc0cdcf5c018fb # v1.11.0
with:
version: "v0.22.0"
- name: Run chart-testing lint and install
# We are only testing that everything installs and the k6 tests start. The k6 tests will just get
# errors because the endpoint doesn't exist, which is fine for making sure everything deploys. We
# can come back and do a full app deploy with wasmCloud and check results later.
#
# A couple of notes about the other flags here:
# - The fullnameOverride is needed because the generated test name makes the service name too long in the k6-operator
# - The fullnameOverride isn't in the values schema for the k6-operator, so we need to skip schema validation
run: |
ct lint-and-install --config charts/benchmark/ct.yaml --helm-extra-set-args='--set=test.url=http://fake-url:8000,k6-operator.fullnameOverride=test --skip-schema-validation'
publish:
if: ${{ startsWith(github.ref, 'refs/tags/benchmark-chart-v') }}
runs-on: ubuntu-latest
needs: validate
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: ${{ env.HELM_VERSION }}
- name: Package
run: |
helm package charts/benchmark --dependency-update -d .helm-charts
- name: Login to GHCR
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Lowercase the organization name for ghcr.io
run: |
echo "GHCR_REPO_NAMESPACE=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
- name: Publish
run: |
for chart in .helm-charts/*; do
if [ -z "${chart:-}" ]; then
break
fi
helm push "${chart}" "oci://ghcr.io/${{ env.GHCR_REPO_NAMESPACE }}/charts"
done