-
Notifications
You must be signed in to change notification settings - Fork 53
166 lines (159 loc) · 7.33 KB
/
tests_sc.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: sc tests
# This file is part of t8code.
# t8code is a C library to manage a collection (a forest) of multiple
# connected adaptive space-trees of general element types in parallel.
#
# Copyright (C) 2015 the developers
#
# t8code is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# t8code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with t8code; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# This github CI script installs t8code and runs its tests for various configurations.
# We compile sc as a thirdparty library and use caching to only trigger a
# new installation of them when their versions have changed in t8code.
#
# Note: To manually enforce a sc installation, either increase the counter
# in the "key:" entries of the sc step or set the variables
# SC_IGNORE_CACHE to 1 in the respective steps.
env:
MAKEFLAGS: "-j2 V=0"
on:
push:
branches:
- main
- develop
- feature-*CI* # for testing this script, all feature branches with "CI" in their name
pull_request:
branches:
- main
- develop
workflow_dispatch: # Be able to trigger this manually on github.com
# Run every night at 1:10
schedule:
- cron: '10 1 * * *'
jobs:
build:
if: (github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') || (github.event_name != 'schedule')
runs-on: ubuntu-20.04
container: dlramr/t8code-ubuntu:t8-dependencies
timeout-minutes: 90
steps:
#
# Setup and bootstrap
#
- uses: actions/checkout@v4
- name: Update packages
run: apt-get update && apt-get upgrade -y
# This seems to be necessary because of the docker container
- name: disable ownership checks
run: git config --global --add safe.directory '*'
- name: init submodules
run: git submodule init
- name: update submodules
run: git submodule update
- name: bootstrap
run: ./bootstrap
#
# SC installation
#
- name: store sc folders in var
run: echo SC_DEBUG=$PWD/sc/build_debug >> $GITHUB_ENV
&& echo SC_RELEASE=$PWD/sc/build_release >> $GITHUB_ENV
&& echo SC_SERIAL_DEBUG=$PWD/sc/build_serial_debug >> $GITHUB_ENV
&& echo SC_SERIAL_RELEASE=$PWD/sc/build_serial_release >> $GITHUB_ENV
- name: Get sc commit hash
run: hash=`git rev-parse HEAD:sc` && echo sc_commit=$hash >> $GITHUB_ENV
- name: Check cache for previous sc installation
id: sc_cache
uses: actions/cache@v4
with:
path: |
${{ env.SC_DEBUG }}
${{ env.SC_RELEASE }}
${{ env.SC_SERIAL_DEBUG }}
${{ env.SC_SERIAL_RELEASE }}
# You can increase the counter at the end to force a new key and hence recomputing the cache
key: sc-${{ env.sc_commit }}-004
- name: Set ignore cache variable
# If this variable is set 1
# (i.e. SC_IGNORE_CACHE=1) then the cache will be ignored and
# sc is always build.
# We use this mostly for debugging this CI script.
run: echo SC_IGNORE_CACHE=0 >> $GITHUB_ENV
- name: Cache info
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
run: echo No cache found or cache will be ignored. SC_IGNORE_CACHE=$SC_IGNORE_CACHE
- name: if ignore cache, delete folders
if: ${{ env.SC_IGNORE_CACHE == 1 }}
# The true at the end is to ignore errors that i.e. occur when the folders do not exist
run: rm -r $SC_DEBUG $SC_RELEASE $SC_SERIAL_DEBUG $SC_SERIAL_RELEASE || true
- name: make folders
run: mkdir $SC_DEBUG && mkdir $SC_RELEASE && mkdir $SC_SERIAL_DEBUG && mkdir $SC_SERIAL_RELEASE
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: install sc
run: echo "Install sc"
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
## sc debug
- name: sc configure debug
run: cd $SC_DEBUG && ../configure --enable-mpi --enable-debug --prefix=$PWD/install
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: sc build debug
run: cd $SC_DEBUG && make $MAKEFLAGS && make $MAKEFLAGS install
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: sc debug check
run: cd $SC_DEBUG && make $MAKEFLAGS check
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: OnFailPrintLog
if: (${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}) && failure()
run: cat $SC_DEBUG/config.log
## sc release
- name: sc configure and build release
run: cd $SC_RELEASE && ../configure --enable-mpi --enable-debug --prefix=$PWD/install
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: sc build release
run: cd $SC_RELEASE && make $MAKEFLAGS && make $MAKEFLAGS install
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: sc release check
run: cd $SC_RELEASE && make $MAKEFLAGS check
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: OnFailPrintLog
if: (${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}) && failure()
run: cat $SC_RELEASE/config.log
## sc serial debug
- name: sc configure and build serial debug
run: cd $SC_SERIAL_DEBUG && ../configure --enable-debug --prefix=$PWD/install
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: sc build serial debug
run: cd $SC_SERIAL_DEBUG && make $MAKEFLAGS && make $MAKEFLAGS install
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: sc serial debug check
run: cd $SC_SERIAL_DEBUG && make $MAKEFLAGS check
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: OnFailPrintLog
if: (${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}) && failure()
run: cat $SC_SERIAL_DEBUG/config.log
## sc serial release
- name: sc configure and build serial release
run: cd $SC_SERIAL_RELEASE && ../configure --prefix=$PWD/install
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: sc build release serial
run: cd $SC_SERIAL_RELEASE && make $MAKEFLAGS && make $MAKEFLAGS install
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: sc release debug check
run: cd $SC_SERIAL_RELEASE && make $MAKEFLAGS check
if: ${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}
- name: OnFailPrintLog
if: (${{ steps.sc_cache.outputs.cache-hit != 'true' || env.SC_IGNORE_CACHE == 1 }}) && failure()
run: cat $SC_SERIAL_RELEASE/config.log
# SC END