-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (92 loc) · 3.4 KB
/
Copy pathbuild.yml
File metadata and controls
104 lines (92 loc) · 3.4 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
name: Run case studies
on:
# Push to main or PR
push:
branches:
- main
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
# Scheduled build at 0300 UTC on Tuesday mornings to detect bitrot.
- cron: '0 3 * * 2'
concurrency:
# Cancels jobs running if new commits are pushed
group: >
${{ github.workflow }}-
${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: "Build Gusto"
# The type of runner that the job will run on
runs-on: [self-hosted, Linux]
# The docker container to use.
container:
image: firedrakeproject/firedrake-vanilla-default:latest
env:
# Make Gusto output logging information, this will *not* be printed to
# the terminal because pytest will capture it. Instead it is written to
# the file specified by '--log-file'.
GUSTO_PARALLEL_LOG: CONSOLE
PYOP2_CFLAGS: -O0
# Make sure that tests with >1 processes are not silently skipped
PYTEST_MPI_MAX_NPROCS: 1
EXTRA_PYTEST_ARGS: --durations=100 --timeout=3600 --timeout-method=thread -o faulthandler_timeout=3660 --verbose case_studies-repo/case_studies
steps:
- name: Fix HOME
# For unknown reasons GitHub actions overwrite HOME to /github/home
# which will break everything unless fixed
# (https://github.com/actions/runner/issues/863)
run: echo "HOME=/home/firedrake" >> "$GITHUB_ENV"
- name: Pre-cleanup
run: |
: # Wipe everything away in the current directory
find . -delete
firedrake-clean
- uses: actions/checkout@v4
with:
repository: firedrakeproject/gusto
# Download Gusto into a subdirectory not called 'gusto' to make sure
# that the package installs correctly. Otherwise 'import gusto' may
# work even if the installation failed because it is a subdirectory.
path: gusto-repo
- uses: actions/checkout@v4
# Check out the case studies repo
with:
repository: firedrakeproject/gusto_case_studies
path: case_studies-repo
- name: Create virtual environment
# pass '--system-site-packages' so Firedrake can be found
run: python3 -m venv --system-site-packages venv-gusto
- name: Install Gusto
id: install-one
run: |
. venv-gusto/bin/activate
pip install ./gusto-repo
pip list
- name: Run tests (nprocs = 1)
run: |
. venv-gusto/bin/activate
: # Use pytest-xdist here so we can have a single collated output (not possible
: # for parallel tests)
firedrake-run-split-tests 1 1 -n 12 --dist worksteal "$EXTRA_PYTEST_ARGS" --log-file=gusto1.log
timeout-minutes: 120
- name: Upload pytest log files
uses: actions/upload-artifact@v4
if: success() || steps.install-one.conclusion == 'success'
with:
name: pytest-logs
path: pytest_*.log
retention-days: 5
- name: Upload Gusto log files
uses: actions/upload-artifact@v4
if: success() || steps.install-one.conclusion == 'success'
with:
name: gusto-logs
path: gusto*.log
retention-days: 5
- name: Post-cleanup
if: always()
run: |
find . -delete
firedrake-clean