-
Notifications
You must be signed in to change notification settings - Fork 8
111 lines (94 loc) · 3.25 KB
/
Copy pathci.yml
File metadata and controls
111 lines (94 loc) · 3.25 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
name: Static quality and data integrity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.10"
cache: pip
cache-dependency-path: requirements*.txt
- run: python -m pip install -r requirements-dev.txt
- name: Install shell quality tooling
run: sudo apt-get update && sudo apt-get install -y shellcheck
- name: Python format, lint, and types
run: |
ruff format --check rewardharness scripts examples tests vanilla
ruff check rewardharness scripts examples tests vanilla
mypy rewardharness scripts/check_distribution.py scripts/check_release_metadata.py
- name: Rating and shell integrity
run: |
python scripts/check_rating_integrity.py
python scripts/check_migration_coverage.py
python scripts/check_release_metadata.py
pip-audit -r requirements.txt
for file in scripts/*.sh scripts/lib/*.sh; do bash -n "$file"; done
shellcheck scripts/*.sh scripts/lib/*.sh
test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: requirements*.txt
- name: Install development dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
- name: Run test suite with coverage
run: python -m pytest tests/ -v --tb=short --cov=rewardharness --cov-report=term-missing
- name: Smoke-test library inspection
run: python -m rewardharness.cli inspect
package:
name: Validate distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
cache: pip
- name: Install release tooling
run: python -m pip install build twine
- name: Build and check distributions
run: |
python -m build
python -m twine check dist/*
python scripts/check_distribution.py
- name: Test wheel installation
run: |
python -m venv /tmp/rewardharness-wheel
/tmp/rewardharness-wheel/bin/pip install dist/*.whl
/tmp/rewardharness-wheel/bin/rewardharness --version
/tmp/rewardharness-wheel/bin/rewardharness inspect
/tmp/rewardharness-wheel/bin/rewardharness release-status
- name: Upload distributions
uses: actions/upload-artifact@v6
with:
name: distributions
path: dist/
if-no-files-found: error