-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreusable-python-testing-linting.yml
More file actions
62 lines (57 loc) · 1.68 KB
/
reusable-python-testing-linting.yml
File metadata and controls
62 lines (57 loc) · 1.68 KB
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
name: reusable-testing-linting-pipeline
on:
workflow_call:
env:
JEST_JUNIT_OUTPUT_FILE: "/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/*.xml"
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
checks: write
issues: read
pull-requests: write
jobs:
Unit-Tests:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.11]
permissions:
contents: read
issues: read
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Git clone the repository
uses: actions/checkout@v3
- name: Install Dependencies
run: |
pip install -r requirements.txt
- name: Run Tests
run: |
pytest --junitxml=unit-test-results.xml
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: Unit-Tests-Report
junit_files: ${{ env.JEST_JUNIT_OUTPUT_FILE }}
Linting:
name: Linting with ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Lint with Ruff
run: |
pip install ruff
ruff check --output-format=github .
continue-on-error: false