Skip to content

Commit 136cf7c

Browse files
authored
Merge pull request #1 from awvwgk/fpm-cd
Minor adjustments to deployment script
2 parents b81199e + 64ec9f8 commit 136cf7c

File tree

4 files changed

+46
-26
lines changed

4 files changed

+46
-26
lines changed

.github/workflows/fpm-deployment.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- name: Generate stdlib-fpm package 🔧
2424
run: |
25-
sh ./ci/fpm-deployment.sh
25+
bash ./ci/fpm-deployment.sh
2626
2727
- name: Install GFortran
2828
run: |
@@ -48,4 +48,4 @@ jobs:
4848
if: github.event_name != 'pull_request'
4949
with:
5050
BRANCH: stdlib-fpm
51-
FOLDER: stdlib-fpm
51+
FOLDER: stdlib-fpm

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ API-doc/
3939

4040
# Build directory for out-of-tree builds
4141
/build
42+
/stdlib-fpm
4243

4344
# Emacs backup files
4445
*~

ci/fpm-deployment.sh

+38-19
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,50 @@
11
#!/usr/bin/env bash
2-
#
3-
#
2+
43
set -ex
54

6-
DESTDIR="stdlib-fpm"
5+
# Target directory to deploy stdlib to
6+
destdir="${DESTDIR:-stdlib-fpm}"
7+
8+
# Get fypp preprocessor
9+
fypp="${FYPP:-$(which fypp)}"
10+
11+
# Arguments for the fypp preprocessor
12+
fyflags="${FYFLAGS:--DMAXRANK=4}"
713

8-
FYFLAGS="-DMAXRANK=4"
14+
# Number of parallel jobs for preprocessing
15+
njob="$(nproc)"
916

10-
mkdir -p $DESTDIR/src
11-
mkdir -p $DESTDIR/test
17+
# Additional files to include
18+
include=(
19+
"ci/fpm.toml"
20+
"LICENSE"
21+
)
22+
23+
# Files to remove from collection
24+
prune=(
25+
"$destdir/test/test_always_fail.f90"
26+
"$destdir/test/test_always_skip.f90"
27+
"$destdir/test/test_mean_f03.f90"
28+
"$destdir/src/common.f90"
29+
"$destdir/src/f18estop.f90"
30+
)
31+
32+
mkdir -p "$destdir/src" "$destdir/test"
1233

1334
# Preprocess stdlib sources
14-
ls src/*.fypp | cut -f1 -d. | xargs -i{} fypp {}.fypp {}.f90 $FYFLAGS
35+
find src -maxdepth 1 -iname "*.fypp" \
36+
| cut -f1 -d. | xargs -P "$njob" -I{} "$fypp" "{}.fypp" "$destdir/{}.f90" $fyflags
37+
38+
# Collect stdlib source files
39+
find src -maxdepth 1 -iname "*.f90" -exec cp {} "$destdir/src/" \;
40+
find src/tests -name "test_*.f90" -exec cp {} "$destdir/test/" \;
41+
find src/tests -name "*.dat" -exec cp {} "$destdir/" \;
1542

16-
# Collect stdlib files
17-
find src -maxdepth 1 -iname "*.f90" -exec cp {} $DESTDIR/src/ \;
18-
find src/tests -name "test_*.f90" -exec cp {} $DESTDIR/test/ \;
19-
find src/tests -name "*.dat" -exec cp {} $DESTDIR/ \;
20-
cp LICENSE $DESTDIR/
21-
cp ci/fpm.toml $DESTDIR/
43+
# Include additional files
44+
cp "${include[@]}" "$destdir/"
2245

2346
# Source file workarounds for fpm
24-
rm $DESTDIR/test/test_always_fail.f90
25-
rm $DESTDIR/test/test_always_skip.f90
26-
rm $DESTDIR/test/test_mean_f03.f90
27-
rm $DESTDIR/src/common.f90
28-
rm $DESTDIR/src/f18estop.f90
47+
rm "${prune[@]}"
2948

3049
# List stdlib-fpm package contents
31-
ls -R $DESTDIR
50+
ls -R "$destdir"

ci/fpm.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name = "stdlib"
2-
version = "0.0.0"
3-
license = "MIT"
4-
author = "stdlib contributors"
5-
copyright = "2019-2021 stdlib contributors"
1+
name = "stdlib"
2+
version = "0.0.0"
3+
license = "MIT"
4+
author = "stdlib contributors"
5+
copyright = "2019-2021 stdlib contributors"

0 commit comments

Comments
 (0)