forked from FreeFem/FreeFem-sources
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (133 loc) · 4.79 KB
/
full-openmpi.yml
File metadata and controls
155 lines (133 loc) · 4.79 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
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
# Full version of FreeFem, using Open MPI
name: Full version Open MPI
on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
workflow_call:
inputs:
build-types:
description: 'Build types as JSON array'
required: false
type: string
default: '["debug", "release"]'
versions:
description: 'Ubuntu version as JSON array'
required: false
type: string
default: '[22.04, 24.04]'
skip_check:
required: false
type: boolean
default: false
upload_build_artifacts:
required: false
type: boolean
default: false
# For development phase
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
linux:
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(inputs.versions || '[22.04, 24.04]') }}
build-type: ${{ fromJson(inputs.build-types || '["debug", "release"]') }}
name: Ubuntu ${{ matrix.version }} with ${{ matrix.build-type }} \
- ${{ github.workflow }}
env:
INSTALL_DIR: /usr/local
runs-on: ubuntu-${{ matrix.version }}
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y gcc g++ gfortran m4 patch git wget cmake \
libhdf5-dev flex bison autoconf automake unzip patch \
autotools-dev libopenmpi-dev python3 freeglut3-dev
- name: Set configure flags and variables
id: flags
run: |
if [ "${{ matrix.build-type }}" = "debug" ]; then
echo "configure-flags=--enable-debug" >> $GITHUB_OUTPUT
elif [ "${{ matrix.build-type }}" = "release" ]; then
echo "configure-flags=--enable-optim --enable-generic" >> $GITHUB_OUTPUT
fi
echo "staging-dir=${{ github.workspace }}/install_staging" >> $GITHUB_OUTPUT
- name: CPU info
run: lscpu
- name: Extract PETSc and runner info
id: petsc-info
run: |
VERSION=$(grep -E -o "petsc-([0-9]{1,}\.)+[0-9]{1,}" 3rdparty/getall | head -1)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "image=$ImageOS" >> $GITHUB_OUTPUT
echo "home=$HOME" >> $GITHUB_OUTPUT
- name: Prepare PETSc cache directory permissions
run: |
sudo mkdir -p "${INSTALL_DIR}/ff-petsc"
sudo chown -R "$USER:$USER" "${INSTALL_DIR}/ff-petsc"
- name: Cache PETSc installation
id: cache-petsc
uses: actions/cache@v5
with:
path: |
${{ env.INSTALL_DIR }}/ff-petsc
key: "petsc-Full version Open MPI-${{ steps.petsc-info.outputs.image }}-${{ matrix.cfg.opts }}-${{ steps.petsc-info.outputs.version }}-${{ hashFiles('3rdparty/ff-petsc/Makefile') }}"
- name: Configure
run: |
autoreconf -i
./configure --enable-download ${{ steps.flags.outputs.configure-flags }} \
--prefix="$INSTALL_DIR"
- name: PETSc
if: steps.cache-petsc.outputs.cache-hit != 'true'
run: |
./3rdparty/getall -a -o PETSc
cd 3rdparty/ff-petsc
sudo make petsc-slepc
cd -
./reconfigure
- name: Upload PETSc and reconfigure logs on fail
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: PETSc-reconfigure-logs
path: |
3rdparty/ff-petsc/petsc-*/configure.log
config.log
compression-level: 9
# Weird problem of permission on libfftw3.la without sudo
- name: Build
run: sudo make -j 4
- name: Check
if: ${{ inputs.skip_check == false }}
run: |
make check -i
./etc/actions/failed_tests_logs.sh
- name: Install to staging directory
if: ${{ inputs.upload_build_artifacts == true }}
run: |
mkdir -p ${{ steps.flags.outputs.staging-dir }}/$INSTALL_DIR
sudo make install DESTDIR=${{ steps.flags.outputs.staging-dir }}
sudo cp -r $INSTALL_DIR/ff-petsc ${{ steps.flags.outputs.staging-dir }}/$INSTALL_DIR
- name: Tar to keep permission when upload/download
if: ${{ inputs.upload_build_artifacts == true }}
run: |
cd ${{ steps.flags.outputs.staging-dir }}/${{ env.INSTALL_DIR }}
tar czf ${{ github.workspace }}/install_tree.tar.gz .
- name: Upload
if: ${{ inputs.upload_build_artifacts == true }}
uses: actions/upload-artifact@v7
with:
name: install_tree_${{ matrix.version }}
path: install_tree.tar.gz
retention-days: 1
# No test for macOS, the homebrew bottle open-mpi seems broken.