-
Notifications
You must be signed in to change notification settings - Fork 12
39 lines (36 loc) · 1008 Bytes
/
ci.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
name: Lint Files
on:
push:
branches:
- "*"
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: install Poetry
uses: snok/[email protected]
- name: install dependencies
run: poetry install
- name: flake8 check
run: poetry run flake8 .
- name: black check
run: poetry run black --check --diff .
- name: ensure shell scripts are formatted
run: |
while IFS= read -r -d '' filename; do
echo "processing ${filename}"
docker run --rm -v "$(pwd):/mnt" koalaman/shellcheck:latest -x "${filename}"
done < <(find . -type f -name "*.sh" ! -path "*/.git/*" -print0)
- name: Yaml file linting
run: |
docker run --rm \
-v $(pwd):/code \
registry.gitlab.com/pipeline-components/yamllint:latest -s .