-
Notifications
You must be signed in to change notification settings - Fork 8
37 lines (34 loc) · 1.21 KB
/
python-format-and-tests.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
name: "Check python code format and tests"
# See https://black.readthedocs.io/en/stable/integrations/github_actions.html
on: [push, pull_request]
jobs:
check-python-with-black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare-python
- uses: psf/black@stable
with:
options: "--check --diff --verbose --color --force-exclude '^snapshot_manager/tests/test_logs/'"
run-tests:
name: run-tests
# We have tests in a python script that uses the dnf module, and this
# module can only be install via the package manager, so we need to
# use ubuntu-24.04, because the system version of python (3.12)
# matches the version we use in ./.github/actions/prepare-python.
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare-python
- name: Run pytest with coverage
shell: bash -e {0}
env:
GH_TEST_TOKEN: ${{ secrets.GH_TEST_TOKEN }}
run: |
coverage run -m pytest
coverage report -m
- name: Coveralls
uses: coverallsapp/github-action@v2.2.3
with:
format: python
file: .coverage