Repository navigation
94 lines (83 loc) · 3.13 KB
/
Copy pathshared-testing-python.yml
File metadata and controls
94 lines (83 loc) · 3.13 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
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
#file: noinspection UndefinedAction,UndefinedParamsPresent
name: "Shared: python"
on:
workflow_call:
inputs:
enable_coverage:
description: 'Enable code coverage collection'
type: boolean
required: false
default: true
target_sha:
type: string
required: true
workflow_url:
type: string
required: true
permissions:
contents: read
statuses: write
checks: write
jobs:
python-tests:
name: "CI: python"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set Python Check Pending
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ./.github/actions/sync-check
with:
repo: ${{ github.repository }}
sha: ${{ inputs.target_sha }}
context: "CI: python"
state: pending
status-description: Python tests in progress
target-url: ${{ inputs.workflow_url }}
allow-status-422: 'true'
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: '3.x'
- name: Install Test Deps
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov
- name: Run Pytest
shell: bash
run: |
if [ "${{ inputs.enable_coverage }}" = "true" ]; then
python -m pytest -q \
--cov=scripts \
--cov-report=lcov:python-coverage/lcov.info
else
python -m pytest -q
fi
- name: Upload Python Coverage
if: ${{ inputs.enable_coverage == true && success() }}
uses: actions/upload-artifact@v7
with:
name: python-coverage
path: python-coverage/lcov.info
if-no-files-found: warn
retention-days: 1
- name: Run Validations
run: |
python scripts/validate_package_id_prefix.py \
--slnf InfiniFrame.GitHubActions.Release.slnf \
--prefix InfiniLore
- name: Update Python Check
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ./.github/actions/sync-check
with:
repo: ${{ github.repository }}
sha: ${{ inputs.target_sha }}
context: "CI: python"
target-url: ${{ inputs.workflow_url }}
job-status: ${{ job.status }}
success-description: Python tests passed
failure-description: Python tests failed