Repository navigation
72 lines (61 loc) · 2.2 KB
/
Copy pathtest.yml
File metadata and controls
72 lines (61 loc) · 2.2 KB
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
name: Test
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
push:
branches:
- main
# one run per pull request: opening one with a label fires two events at once
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Lint the workflows
run: |
bash <(curl -sSfL https://raw.githubusercontent.com/rhysd/actionlint/v1.7.12/scripts/download-actionlint.bash) 1.7.12
./actionlint -color
- name: Lint the scripts
run: shellcheck scripts/*.sh
# for the lint and eval tests, which skip themselves without them
- name: Install Helm
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
with:
version: v3.17.3
- name: Install kubeconform
run: |
curl -sSfL https://github.com/yannh/kubeconform/releases/download/v0.7.0/kubeconform-linux-amd64.tar.gz \
| sudo tar -xz -C /usr/local/bin kubeconform
- name: Test the scripts
run: |
sudo apt-get install --yes --no-install-recommends bats >/dev/null
bats tests
# The release of a merged pull request follows its semver label, so every pull request needs one.
# This runs chart-pr.yml from the pull request itself: with no charts in this repository it only
# checks the label, and it exercises the workflow before it is released.
semver-label:
if: github.event_name == 'pull_request'
needs: test
uses: ./.github/workflows/chart-pr.yml
permissions:
contents: write
pull-requests: write
# Exercises semver-version.yml before it is released: the version this pull request would release,
# as a pre-release. Only once semver-label passed, so a missing label is reported once.
semver-version:
if: github.event_name == 'pull_request'
needs: semver-label
uses: ./.github/workflows/semver-version.yml
permissions:
contents: read
pull-requests: write