-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 1.56 KB
/
airflow_test.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
name: python static checks and tests
on:
push:
branches: ["main"]
jobs:
testing:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.12.7
architecture: x64
- name: Get changed files
id: changed-files
run: echo "::set-output name=files::$(git diff --name-only ${{ github.sha }} ${{ github.event.before }})"
- name: Extract directories
id: extract-dirs
run: echo "::set-output name=dirs::$(echo '${{ steps.changed-files.outputs.files }}' | xargs -n1 dirname | sort -u)"
- name: Install Flake8
run: pip install flake8
- name: Run Flake8
run: |
for dir in ${{ steps.extract-dirs.outputs.dirs }}; do
flake8 $dir
done
- name: Install Pylint
run: pip install pylint
- name: Run Pylint
run: |
for dir in ${{ steps.extract-dirs.outputs.dirs }}; do
find $dir -name "*.py" | xargs pylint --output-format=colorized
done
- name: Install Black
run: pip install black
- name: Run Black
run: |
for dir in ${{ steps.extract-dirs.outputs.dirs }}; do
find $dir -name "*.py" | xargs black --check
done
- name: Install dependencies
run: pip install apache-airflow pytest
- name: Test DAG integrity
run: |
for dir in ${{ steps.extract-dirs.outputs.dirs }}; do
pytest $dir/tests/
done