-
Notifications
You must be signed in to change notification settings - Fork 3
116 lines (96 loc) · 2.89 KB
/
build.yml
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
name: CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
linux:
strategy:
matrix:
py-version: ['3.10', '3.11']
fail-fast: false
name: Python ${{ matrix.py-version }}
runs-on: ubuntu-latest
timeout-minutes: 180
env:
MPIEXEC_FLAGS: "--allow-run-as-root --oversubscribe"
PYNUCLEUS_BUILD_PARALLELISM: 2
steps:
- name: Check out repo
if: always()
uses: actions/checkout@v3
- name: Pull ccache cache
if: always()
id: ccache-restore
uses: actions/cache/restore@v3
with:
path: /home/runner/.cache/ccache
key: ccache-${{ matrix.py-version }}
- uses: actions/setup-python@v4
if: always()
with:
python-version: ${{ matrix.py-version }}
- name: Install Ubuntu packages
if: always()
run: |
sudo apt-get update
sudo apt-get install mpi-default-bin mpi-default-dev libmetis-dev libparmetis-dev libsuitesparse-dev ccache
- name: Get ccache config dir
if: always()
run: ccache --show-config
- name: Install Python dependencies
if: always()
run: make prereq && make prereq-extra
- name: Install
if: always()
run: python -m pip install wheel && python -m pip list && make install PIP_INSTALL_FLAGS="--no-use-pep517"
- name: Remove ccache cache
if: ${{ steps.ccache-restore.outputs.cache-hit }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete ccache-${{ matrix.py-version }} --confirm
continue-on-error: true
- name: Push ccache cache
if: always()
uses: actions/cache/save@v3
with:
path: /home/runner/.cache/ccache
key: ccache-${{ matrix.py-version }}
- name: Ccache report
if: always()
run: ccache -s
- name: Run tests
if: always()
run: python3 -m pytest --junit-xml=test-results-${{ matrix.py-version }}.xml tests/
- name: Run flake8
if: always()
run: |
make flake8
mv flake8.xml flake8-${{ matrix.py-version }}.xml
- name: Archive test results
uses: actions/upload-artifact@v3
if: always()
with:
name: Test results
path: test-results-${{ matrix.py-version }}.xml
- name: Report test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Test report (Python ${{ matrix.py-version }})
path: test-results-${{ matrix.py-version }}.xml
reporter: java-junit
fail-on-error: true
- name: Report flake8 results
uses: dorny/test-reporter@v1
if: always()
with:
name: Flake8 report (Python ${{ matrix.py-version }})
path: flake8-${{ matrix.py-version }}.xml
reporter: java-junit
fail-on-error: false