-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (78 loc) · 2.53 KB
/
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
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
name: Checks
on:
pull_request:
branches: ['**']
push:
branches: ['main']
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
python:
name: Python
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Setup Virtualenv Cache
uses: actions/[email protected]
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Set up Python 3.10
uses: actions/[email protected]
with:
python-version: "3.10.13"
- name: Setup Poetry
uses: Gr1N/setup-poetry@v9
- name: Install Python Dependencies
run: |
poetry check --lock
poetry install --no-root
- name: Check poetry config
run: poetry check
- name: Lint Python code
run: |
poetry run ruff format . --check
poetry run ruff check .
- name: Check type annotations
run: poetry run mypy
- name: Check if requirements.txt is up-to-date
run: poetry export --output requirements.txt | git diff --exit-code
- name: Audit Python dependencies
run: poetry run pip-audit --requirement requirements.txt
continue-on-error: true
Container:
name: Container
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Run the checks inside Docker
uses: addnab/docker-run-action@v3
with:
image: amazon/aws-glue-libs:glue_libs_4.0.0_image_01
options: --volume ${{ github.workspace }}:/home/glue_user/workspace
run: |
pip3 install --no-warn-script-location --user --upgrade pip==24.0
pip3 install --no-warn-script-location --user -r requirements.txt
/home/glue_user/.local/bin/ruff format . --check --no-cache
/home/glue_user/.local/bin/ruff check . --no-cache
/home/glue_user/.local/bin/mypy
/home/glue_user/.local/bin/pytest -p no:cacheprovider
shell:
name: Shell
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Check shell scripts
uses: ludeeus/[email protected]
with:
scandir: '.'
dockerfile:
name: Dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Validate Dockerfile using hadolint
uses: hadolint/[email protected]