-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (50 loc) · 1.74 KB
/
lint-workflow-templates.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
name: Lint Workflow Templates
on:
push:
branches:
- main
pull_request:
jobs:
lint-workflow-templates:
runs-on: ubuntu-latest
steps:
- name: Checkout latest changes from the PR branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up Kind cluster with Helm
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
with:
cluster_name: argo-lint-cluster
- name: Helm Install Argo
run: |
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
kubectl create namespace argo
helm install argo argo/argo-workflows --namespace argo
- name: Install Argo CLI
run: |
curl -sLO https://github.com/argoproj/argo-workflows/releases/latest/download/argo-linux-amd64.gz
gunzip argo-linux-amd64.gz
chmod +x argo-linux-amd64
sudo mv argo-linux-amd64 /usr/local/bin/argo
argo version
- name: Argo Lint Workflow Template
run: |
set +e
FAILED=""
for file in workflows/argo-events/workflowtemplates/*.yaml; do
echo "Linting workflow template: $file"
if ! argo lint "$file"; then
echo "::error file=$file, title=argo lint failed"
FAILED="$FAILED $file"
fi
done
echo "FAILED_WORKFLOWS=$FAILED" >> $GITHUB_ENV
exit 0
- name: Report Lint Results
run: |
if [ -n "${{ env.FAILED_WORKFLOWS }}" ]; then
echo "The following workflows failed linting:"
echo "${FAILED_WORKFLOWS}"
exit 1
fi
echo "All workflows passed linting!"