Repository navigation
81 lines (64 loc) · 2.36 KB
/
Copy pathtest.yml
File metadata and controls
81 lines (64 loc) · 2.36 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
name: test
on:
workflow_call:
inputs:
python-version:
required: true
type: string
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install just
uses: extractions/setup-just@v4
with:
just-version: "1.51.0"
- name: Set up Python
run: uv python install 3.12
- name: Sync environment
run: uv sync --frozen
# Runs the pre-commit hooks, which include `just lint` and `just typecheck` (mypy).
- name: pre-commit
run: just precommit
test:
needs: [lint]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install just
uses: extractions/setup-just@v4
with:
just-version: "1.51.0"
- name: Set up Python
run: uv python install ${{ inputs.python-version }}
- name: Sync environment
run: uv sync --frozen --python ${{ inputs.python-version }}
- name: Clone unified-planning test cases (matching the locked commit)
run: |
# Use system python3 (>= 3.11) instead of `uv run python` so this
# step works on the 3.10 matrix entry where tomllib is missing.
sha=$(python3 -c "import tomllib; d = tomllib.load(open('uv.lock', 'rb')); print(next(p['source']['git'].rsplit('#', 1)[1] for p in d['package'] if p['name'] == 'unified-planning'))")
git clone --filter=blob:none https://github.com/aiplan4eu/unified-planning.git up-checkout
git -C up-checkout checkout "$sha"
- name: Register CPSE engines
run: |
printf '[engine cpse]\nmodule_name: cpse\nclass_name: CPSE\n\n[engine cpse-timepoints]\nmodule_name: cpse\nclass_name: CPSETimepoints\n' > .up.ini
- name: Run UP test report (cpse)
run: uv run python up-checkout/up_test_cases/report.py cpse
- name: Run UP test report (cpse-timepoints)
run: uv run python up-checkout/up_test_cases/report.py cpse-timepoints
- name: Run CPSE pytest suite
run: just test