forked from IABTechLab/fideslang
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (114 loc) · 3.49 KB
/
pr_checks.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Static Checks
on:
pull_request:
branches:
- "*"
env:
CONTAINER: fideslang-local
IMAGE: ethyca/fideslang:local
DEFAULT_PYTHON_VERSION: "3.10.11"
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build fideslang container
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
target: prod
outputs: type=docker,dest=/tmp/${{ env.CONTAINER }}.tar
push: false
tags: ${{ env.IMAGE }}
- name: Upload fideslang container
uses: actions/upload-artifact@v4
with:
name: ${{ env.CONTAINER }}
path: /tmp/${{ env.CONTAINER }}.tar
retention-days: 1
Export:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: "3.10.11"
cache: "pip"
- name: Pin Cython
run: |
echo 'Cython < 3.0' > /tmp/constraint.txt
PIP_CONSTRAINT=/tmp/constraint.txt pip wheel PyYAML==5.4.1
pip install 'PyYAML==5.4.1'
- name: Install Package
run: pip install .
- name: Run Export
run: python scripts/export_default_taxonomy.py
Static-Checks:
continue-on-error: true
strategy:
matrix:
session_name: ["black", "mypy", "pylint", "xenon"]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
cache: "pip"
- name: Pin Cython
run: |
echo 'Cython < 3.0' > /tmp/constraint.txt
PIP_CONSTRAINT=/tmp/constraint.txt pip wheel PyYAML==5.4.1
pip install 'PyYAML==5.4.1'
- name: Install Nox
run: pip install nox
- name: Run Static Check
run: nox -s ${{ matrix.session_name }}
Pytest-Matrix:
strategy:
matrix:
python_version: ["3.9", "3.10", "3.11"]
pydantic_version: ["2.3.0", "2.4.2", "2.5.3", "2.6.4", "2.7.1"]
pyyaml_version: ["5.4.1", "6.0.1"]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
cache: "pip"
- name: Pin Cython
run: |
echo 'Cython < 3.0' > /tmp/constraint.txt
PIP_CONSTRAINT=/tmp/constraint.txt pip wheel PyYAML==5.4.1
pip install 'PyYAML==5.4.1'
- name: Install Nox
run: pip install nox
- name: Run Tests
run: nox -s "tests-${{ matrix.python_version }}(pyyaml_version='${{ matrix.pyyaml_version }}', pydantic_version='${{ matrix.pydantic_version }}')"
CSV-Checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check CSV Files
run: |
echo "Check all data_files/*.csv for any empty lines..."
ls -l data_files/*.csv
if grep -n -E '^$' data_files/*.csv; then
echo "Error: empty lines found (see grep matches above)"
exit 1
fi
echo "Success!"