Skip to content

Commit f2330cc

Browse files
committed
CI: Use build_locally.sh[F
1 parent 314333b commit f2330cc

3 files changed

Lines changed: 35 additions & 12 deletions

File tree

.ci_support/run_docker_linux.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
set -xe
44

55
cd /tmp
6-
mkdir build && cd build
76
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/.local \
87
-DCMAKE_UNITY_BUILD=ON \
98
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Wshadow -Werror -D_GLIBCXX_ASSERTIONS --coverage" \
109
-DSWIG_COMPILE_FLAGS="-O1 -Wno-unused-parameter" \
1110
-DUSE_SPHINX=ON -DSPHINX_FLAGS="-W -T -j4" \
12-
/io
11+
-B build /io
12+
cd build
1313
make install
1414
make tests
1515
ctest --output-on-failure --timeout 100 ${MAKEFLAGS}
@@ -20,10 +20,9 @@ lcov --capture --directory . --output-file coverage.info --include "*.cxx"
2020
genhtml --output-directory coverage coverage.info
2121
cp -v coverage.info coverage
2222

23-
uid=$1
24-
gid=$2
25-
if test -n "${uid}" -a -n "${gid}"
23+
UID_GID=$1
24+
if test -n "${UID_GID}"
2625
then
26+
sudo chown -R ${uid}:${gid} ~/.local/share/doc/*/html
2727
sudo cp -r ~/.local/share/doc/*/html /io
28-
sudo chown -R ${uid}:${gid} /io/html
2928
fi

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
jobs:
77
linux:
88
runs-on: ubuntu-latest
9+
env:
10+
MAKEFLAGS: -j4
911
steps:
1012
- uses: actions/checkout@v4
1113
- name: Build
12-
run: |
13-
docker pull openturns/archlinux-module
14-
docker run -e MAKEFLAGS='-j4' -v `pwd`:/io openturns/archlinux-module /io/.ci_support/run_docker_linux.sh `id -u` `id -g`
14+
run: ./utils/build_locally.sh linux
1515
- name: Upload
1616
if: ${{ github.ref == 'refs/heads/master' }}
1717
run: |
@@ -29,9 +29,9 @@ jobs:
2929
3030
mingw:
3131
runs-on: ubuntu-latest
32+
env:
33+
MAKEFLAGS: -j4
3234
steps:
3335
- uses: actions/checkout@v4
3436
- name: Build
35-
run: |
36-
docker pull openturns/archlinux-module-mingw
37-
docker run -e MAKEFLAGS='-j4' -v `pwd`:/io openturns/archlinux-module-mingw /io/.ci_support/run_docker_mingw.sh
37+
run: ./utils/build_locally.sh mingw

utils/build_locally.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
if test "$#" -lt 1
4+
then
5+
echo -e "1. linux\n2. mingw\n\n> "
6+
read choice
7+
else
8+
choice="$1"
9+
fi
10+
11+
case $choice in
12+
"1" | "linux")
13+
docker pull openturns/archlinux-module
14+
docker run --rm -e MAKEFLAGS -e OPENTURNS_NUM_THREADS=2 -v `pwd`:/io openturns/archlinux-module /io/.ci_support/run_docker_linux.sh `id -u`:`id -g`
15+
;;
16+
"2" | "mingw")
17+
docker pull openturns/archlinux-module-mingw
18+
docker run --rm -e MAKEFLAGS -e OPENTURNS_NUM_THREADS=2 -v `pwd`:/io openturns/archlinux-module-mingw /io/.ci_support/run_docker_mingw.sh
19+
;;
20+
*)
21+
echo "sorry?"
22+
exit 1
23+
;;
24+
esac

0 commit comments

Comments
 (0)