-
Notifications
You must be signed in to change notification settings - Fork 189
github-ci: add fpm support #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8ef37bc
initial add fpm support.
zoziha b81199e
add ./ci/fpm.toml and update README.md .
zoziha af8b766
Minor adjustments to script
awvwgk 64ec9f8
Use bash instead of POSIX sh for deployment script
awvwgk 136cf7c
Merge pull request #1 from awvwgk/fpm-cd
zoziha 7abb413
A minor fix.
zoziha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: fpm-deployment | ||
|
||
on: [push, pull_request] | ||
env: | ||
GCC_V: "10" | ||
|
||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install fypp | ||
run: pip install --upgrade fypp | ||
|
||
- name: Generate stdlib-fpm package 🔧 | ||
run: | | ||
bash ./ci/fpm-deployment.sh | ||
|
||
- name: Install GFortran | ||
run: | | ||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ env.GCC_V }} 100 \ | ||
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ env.GCC_V }} \ | ||
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ env.GCC_V }} | ||
|
||
- name: Install fpm latest release | ||
uses: fortran-lang/setup-fpm@v3 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run fpm test ⚙ | ||
run: | | ||
cp -r stdlib-fpm stdlib-fpm-test | ||
cd stdlib-fpm-test | ||
fpm test | ||
fpm test --profile release | ||
|
||
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm` branch. | ||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
if: github.event_name != 'pull_request' | ||
with: | ||
BRANCH: stdlib-fpm | ||
FOLDER: stdlib-fpm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ API-doc/ | |
|
||
# Build directory for out-of-tree builds | ||
/build | ||
/stdlib-fpm | ||
|
||
# Emacs backup files | ||
*~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
# Target directory to deploy stdlib to | ||
destdir="${DESTDIR:-stdlib-fpm}" | ||
|
||
# Get fypp preprocessor | ||
fypp="${FYPP:-$(which fypp)}" | ||
|
||
# Arguments for the fypp preprocessor | ||
fyflags="${FYFLAGS:--DMAXRANK=4}" | ||
|
||
# Number of parallel jobs for preprocessing | ||
njob="$(nproc)" | ||
|
||
# Additional files to include | ||
include=( | ||
"ci/fpm.toml" | ||
"LICENSE" | ||
) | ||
|
||
# Files to remove from collection | ||
prune=( | ||
"$destdir/test/test_always_fail.f90" | ||
"$destdir/test/test_always_skip.f90" | ||
"$destdir/test/test_mean_f03.f90" | ||
"$destdir/src/common.f90" | ||
"$destdir/src/f18estop.f90" | ||
) | ||
|
||
mkdir -p "$destdir/src" "$destdir/test" | ||
|
||
# Preprocess stdlib sources | ||
find src -maxdepth 1 -iname "*.fypp" \ | ||
| cut -f1 -d. | xargs -P "$njob" -I{} "$fypp" "{}.fypp" "$destdir/{}.f90" $fyflags | ||
|
||
# Collect stdlib source files | ||
find src -maxdepth 1 -iname "*.f90" -exec cp {} "$destdir/src/" \; | ||
find src/tests -name "test_*.f90" -exec cp {} "$destdir/test/" \; | ||
find src/tests -name "*.dat" -exec cp {} "$destdir/" \; | ||
|
||
# Include additional files | ||
cp "${include[@]}" "$destdir/" | ||
|
||
# Source file workarounds for fpm | ||
rm "${prune[@]}" | ||
|
||
# List stdlib-fpm package contents | ||
ls -R "$destdir" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name = "stdlib" | ||
version = "0.0.0" | ||
license = "MIT" | ||
author = "stdlib contributors" | ||
copyright = "2019-2021 stdlib contributors" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.