-
Notifications
You must be signed in to change notification settings - Fork 74
78 lines (62 loc) · 2.2 KB
/
lint.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
---
name: Lint
on:
pull_request:
push:
branches: [main]
concurrency:
group: lint-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
KURTOSIS_VERSION: 0.90.1
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
# Install linters
- name: Install kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli=${{ env.KURTOSIS_VERSION }}
kurtosis analytics disable
- name: Install yamllint
run: pip install yamllint
- name: Install hadolint
run: |
sudo wget -O /usr/local/bin/hadolint https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64
sudo chmod +x /usr/local/bin/hadolint
- name: Install shellcheck
run: sudo apt install shellcheck
# Run linters
- name: Run kurtosis linter
run: kurtosis lint .
- name: Run yamllint
run: yamllint --config-file ${{ github.workspace }}/.yamllint.yml .
- name: Run hadolint
run: find . -type f -name '*.Dockerfile' | sort | xargs -I {} hadolint --config ${{ github.workspace }}/.hadolint.yml {}
- name: Run shellcheck
run: find . -type f -name '*.sh' | sort | xargs -I {} shellcheck {}
check-test-combinations-and-cdk-version-matrix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install yq
run: |
pip3 install yq
yq --version
- name: Generate test combinations and cdk version matrix
working-directory: .github/tests
run: ./combine-ymls.sh
- name: Check if test combinations and cdk version matrix are up to date
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "❌ Error: Test combinations and/or CDK version matrix are not up to date. Please run \`./combine-ymls.sh\`."
git status --porcelain
git diff
exit 1
else
echo "✅ Test combinations are up to date."
fi