-
Notifications
You must be signed in to change notification settings - Fork 40
58 lines (56 loc) · 1.73 KB
/
qa.yaml
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
name: QA
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
python-versions:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.python-versions.outputs.versions }}
steps:
- uses: actions/checkout@v4
- name: Get Python versions
id: python-versions
run: |
CLASSIFIERS="$(yq -p toml -o toml '.project.classifiers[]' pyproject.toml | grep "Programming Language :: Python :: " | grep "\.")"
VERSIONS="$(echo "${CLASSIFIERS}" | sed -e 's/Programming Language :: Python :: \([0-9.]*\)$/"\1"/g' | tr '\n' ',' | sed -e 's/,$//g')"
echo "versions=[${VERSIONS}]" > "${GITHUB_OUTPUT}"
qa:
name: Run QA checks
runs-on: ubuntu-latest
needs: python-versions
strategy:
matrix:
python-version: ${{fromJson(needs.python-versions.outputs.versions)}}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node.js LTS
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install the world
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -e .[dev]
- name: Run linting
run: |
flake8 ./pyee ./tests
validate-pyproject ./pyproject.toml
- name: Run type checking
run: |
npx pyright@latest
- name: Run tests
run: pytest ./tests
actionlint:
name: Run actionlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run actionlint
uses: raven-actions/actionlint@v2