Repository navigation
81 lines (69 loc) · 2.37 KB
/
Copy pathubuntu-python.yml
File metadata and controls
81 lines (69 loc) · 2.37 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: Python tests on Ubuntu
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- 'notebooks/**'
- '**.md'
- '.readthedocs.yaml'
pull_request:
branches:
- '**'
paths-ignore:
- 'docs/**'
- 'notebooks/**'
- '**.md'
- '.readthedocs.yaml'
schedule:
- cron: '0 4 * * 1' # Every Monday at 04:00 UTC
workflow_dispatch:
permissions:
contents: read
# Cancel a PR's previous run when a new commit is pushed. Other events are grouped by commit SHA,
# so pushes to main never cancel each other.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build-and-test:
name: Unit tests via Python on Ubuntu
runs-on: ubuntu-24.04
# Runs on every PR in the private repo; on the public repo it runs for every event.
if: >-
github.repository == 'PalamaraLab/ASMC'
|| github.event_name == 'pull_request'
|| github.event_name == 'workflow_dispatch'
timeout-minutes: 10
strategy:
matrix:
# Oldest and newest supported versions on the public repo. The private repo's minutes are
# billed, so it tests only the newest.
python-version: ${{ fromJSON(github.repository == 'PalamaraLab/ASMC' && '["3.10", "3.14"]' || '["3.14"]') }}
steps:
- name: checkout repo & submodules
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true
fetch-depth: 0
persist-credentials: false
- name: install deps
run: |
sudo apt -y update
sudo apt -y install libboost-iostreams-dev libboost-program-options-dev zlib1g-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: install python bindings
run: |
python -m pip install --upgrade pip setuptools wheel ninja
python -m pip install ".[io]"
- name: python unit tests
run: |
python -m unittest discover test "test_unit*.py"
- name: python regression tests
run: |
python -m unittest discover test "test_regression.py"