-
Notifications
You must be signed in to change notification settings - Fork 53
114 lines (108 loc) · 4.45 KB
/
create_from_cmake_tarball.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
name: CMake Tarball test
# 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) 2024 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 constructs a tarball and checks if it is build correctly.
#
env:
MAKEFLAGS: "-j2 V=0"
on:
push:
workflow_run:
workflows: ["Build tarball using CMake"]
types: [completed]
branches:
- main
- develop
- Cpack # for testing this script, all feature branches with "tarball" in their name
workflow_dispatch:
jobs:
on-success:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-20.04
container: dlramr/t8code-ubuntu:t8-dependencies
timeout-minutes: 90
steps:
- name: triggering workflow
run: echo ${{github.event.workflow_run.name}} && echo ${{github.even.workflow_run.id}}
- name: install sudo
run: apt update && apt install sudo
# On the github Ubuntu 20.04, sudo is not available by default
# we need it, however, to update/upgrade our packages.
- name: Update packages
run: sudo apt-get update && sudo apt-get upgrade -y
# This step is necessary to get the newest package data
- name: Download tarball
uses: actions/download-artifact@v4
with:
run-id: ${{ github.event.workflow_run.id }}
name: tarballs
path: tarballs
- name: Extract tarball
run: tar xzf tarballs/*.tar.gz -C $RUNNER_TEMP
- name: update Github_env
run: export TAR_DIR="$RUNNER_TEMP/`basename tarballs/*.tar.gz .tar.gz`" &&
echo TAR_DIR="$TAR_DIR" >>$GITHUB_ENV
- name: less-test option
if: ${{ inputs.LESS_TESTS }}
run: export LESS_TEST_OPTION="-DT8CODE_ENABLE_LESS_TESTS=ON"
&& echo LESS_TEST_OPTION="$LESS_TEST_OPTION" >> $GITHUB_ENV
- name: build config variables
run: export CONFIG_OPTIONS="${LESS_TEST_OPTION} -GNinja -DT8CODE_USE_SYSTEM_SC=OFF -DT8CODE_USE_SYSTEM_P4EST=OFF -DT8CODE_BUILD_PEDANTIC=ON -DT8CODE_ENABLE_MPI=$MPI -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSC_DIR=$SC_PATH/install/cmake -DP4EST_DIR=$P4EST_PATH/install/cmake"
&& echo CONFIG_OPTIONS="$CONFIG_OPTIONS" >> $GITHUB_ENV
# cmake and test
- name: Printing MPI compiler info
run: mpicc --version && mpirun --version
- name: Printing GCC compiler info
run: gcc --version && g++ --version
- name: echo cmake line
run: echo cmake ../ $CONFIG_OPTIONS
- name: cmake
run: mkdir build && cd build && cmake ../ $CONFIG_OPTIONS
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: cmake_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}.log
path: build/CMakeFiles/CMakeOutput.log
- name: ninja
run: cd build && ninja $MAKEFLAGS
- name: ninja install
run: cd build && ninja install $MAKEFLAGS
- name: serial tests (if MPI is enabled)
run: cd build && ctest $MAKEFLAGS -R _serial
if: ${{ inputs.MPI == 'ON' }}
- name: parallel tests (if MPI is enabled)
run: cd build && ctest -R _parallel
if: ${{ inputs.MPI == 'ON' }}
- name: tests (if MPI is disabled)
run: cd build && ctest $MAKEFLAGS
if: ${{ inputs.MPI == 'OFF' }}
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-suite_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}.log
path: build/Testing/Temporary/LastTest.log
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The triggering workflow failed'