-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (105 loc) · 3.27 KB
/
Copy pathqa.yml
File metadata and controls
130 lines (105 loc) · 3.27 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
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
name: QA & Publish
on:
push:
branches:
- "*"
pull_request:
schedule:
- cron: "0 6 * * 1"
release:
types: [published]
permissions:
contents: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python 3.14
uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install quality dependencies
run: |
python -m pip install --upgrade pip uv
uv pip install --system --upgrade -e ".[dev]"
- name: Check Python formatting (black + isort)
run: |
black . --check
- name: Lint Markdown
uses: DavidAnson/markdownlint-cli2-action@v24
- name: Lint reStructuredText (doc8)
run: |
doc8 docs --max-line-length=120
- name: Run Semgrep SAST
if: github.event_name == 'pull_request' || github.event_name == 'schedule'
uses: semgrep/semgrep-action@v1
with:
config: p/ci
test:
runs-on: ubuntu-latest
needs: quality
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install CI tools
run: |
python -m pip install --upgrade pip uv
uv pip install --system --upgrade -e ".[dev]"
- name: Fetch compliance test cases
run: |
mkdir -p tests/fwf-compliance
curl -sL "https://github.com/fixed-width-file/fwf-compliance-tests/archive/refs/heads/main.zip" -o compliance.zip
unzip -q compliance.zip
cp -r fwf-compliance-tests-main/* tests/fwf-compliance/
rm -rf compliance.zip fwf-compliance-tests-main
- name: Test with coverage
run: |
pytest --cov=pyfwf --cov-report=xml:coverage.xml --cov-report=term-missing
pytest-coverage-gate --coverage-xml=coverage.xml --baseline=.coverage-baseline
- name: Upload coverage artifacts
uses: actions/upload-artifact@v7
with:
name: coverage-reports-py${{ matrix.python-version }}
path: coverage.xml
if-no-files-found: error
- name: Upload coverage to Codecov
if: github.event_name == 'push' || github.event_name == 'schedule'
uses: codecov/codecov-action@v7
with:
use_oidc: true
files: coverage.xml
flags: py${{ matrix.python-version }}
fail_ci_if_error: false
publish:
name: Build and Publish Package
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'release'
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install build
run: pip install build
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1