-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (51 loc) · 1.63 KB
/
main.yaml
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
---
# configuration for GitHub Actions
name: floras tests in PDM env - Ubuntu
on:
push:
pull_request:
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: [
'3.10',
'3.11',
'3.12'
]
steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
cache: true
- name: Setup testing environment
run: |
sudo apt-get update
sudo apt-get install -y \
libgraphviz-dev \
graphviz
- name: Install Python dependencies
run: |
pdm install
- name: Try to use cached Spot
id: cache-spot
uses: actions/cache@v4
with:
path: spot-2.12
key: ${{ runner.os }}-${{ matrix.python-version }}-spot-${{ hashFiles('get_spot.py') }}-${{ hashFiles('pyproject.toml') }}
- name: Install Spot
if: steps.cache-spot.outputs.cache-hit == 'true'
run: |
cd spot-2.12
make install
- name: Build and install Spot
if: steps.cache-spot.outputs.cache-hit != 'true'
run: |
pdm run python get_spot.py
- name: Run tests
run: |
pdm run pytest -v tests