Skip to content

Commit 9e66efc

Browse files
committed
add forlab-fpm .
1 parent 70eddc1 commit 9e66efc

File tree

3 files changed

+77
-6
lines changed

3 files changed

+77
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: fpm-deployment
2+
3+
on: [push, pull_request]
4+
env:
5+
GCC_V: "10"
6+
7+
jobs:
8+
Build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout 🛎️
12+
uses: actions/[email protected]
13+
14+
- name: Set up Python 3.x
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.x
18+
19+
- name: Generate forlab-fpm package 🔧
20+
run: |
21+
bash ./ci/fpm-deployment.sh
22+
23+
- name: Install GFortran
24+
run: |
25+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ env.GCC_V }} 100 \
26+
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ env.GCC_V }} \
27+
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ env.GCC_V }}
28+
29+
- name: Install fpm latest release
30+
uses: fortran-lang/setup-fpm@v3
31+
with:
32+
github-token: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Run fpm test ⚙
35+
run: |
36+
cp -r forlab-fpm forlab-fpm-test
37+
cd forlab-fpm-test
38+
fpm test
39+
40+
# Update and deploy the f90 files generated by github-ci to the `forlab-fpm` branch.
41+
- name: Deploy 🚀
42+
uses: JamesIves/[email protected]
43+
if: github.event_name != 'pull_request' && github.repository == 'fortran-fans/forlab' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/main' )
44+
with:
45+
BRANCH: forlab-fpm
46+
FOLDER: forlab-fpm

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
[![Actions Status](https://github.com/fortran-fans/forlab/workflows/fpm/badge.svg)](https://github.com/fortran-fans/forlab/actions)
44

5-
Forlab is a Fortran module that provides some functions for scientific computing.
5+
FORLAB is a Fortran module that provides some functions for scientific computing.
66
It's more like a small **toolbox**.
7-
Forlab uses [stdlib](https://github.com/fortran-lang/stdlib) as an upstream package. Forlab hopes to be a small scaffolding tool. Compared with [stdlib](https://github.com/fortran-lang/stdlib), Forlab is less formal.
7+
FORLAB uses [stdlib](https://github.com/fortran-lang/stdlib) as an upstream package. FORLAB hopes to be a small scaffolding tool. Compared with [stdlib](https://github.com/fortran-lang/stdlib), FORLAB is less formal.
88

99
| | |
1010
|:-:|---|
1111
| **Version:** | 1.0.1 |
12-
| **Author:** | Forlab Contributors |
12+
| **Author:** | FORLAB Contributors |
1313
| **Web site:** | https://github.com/fortran-fans/forlab |
1414
| **API-Doc Web site:** | https://zoziha.github.io/forlab-API-doc/ |
1515
| **Copyright:** | _This document_ has been placed in the public domain. |
16-
| **License:** | _Forlab_ is released under the MIT License. |
16+
| **License:** | _FORLAB_ is released under the MIT License. |
1717

1818
## Getting Started
1919
### Get the code
@@ -44,15 +44,15 @@ fpm test <test_name, see `fpm.toml` or list>
4444
To use `forlab` within your `fpm` project, add the following to `fpm.toml` file:
4545
```toml
4646
[dependencies] # or [dev-dependencies] for tests.
47-
forlab = { git = "https://github.com/fortran-fans/forlab.git" }
47+
forlab = { git="https://github.com/fortran-fans/forlab.git", branch="forlab-fpm" }
4848
```
4949

5050
## API-Doc
5151

5252
```bash
5353
ford API-doc-FORD-file.md # todo
5454
```
55-
see [forlab-API-doc](https://zoziha.github.io/forlab-API-doc/).
55+
see [forlab-API-doc](https://fortran-fans.github.io/forlab/page/specs/index.html).
5656

5757
Some examples are prepared in the `./example` folder, and you can use `fpm` to run them.
5858
```sh

ci/fpm-deployment.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
# Target directory to deploy stdlib to
6+
destdir="${DESTDIR:-forlab-fpm}"
7+
8+
# Additional files to include
9+
include=(
10+
"fpm.toml"
11+
"LICENSE"
12+
"README.md"
13+
)
14+
15+
mkdir -p "$destdir/src" "$destdir/test"
16+
17+
# Collect stdlib source files
18+
cp src/* "$destdir/src/"
19+
cp -r test/* "$destdir/test/"
20+
21+
# Include additional files
22+
cp "${include[@]}" "$destdir/"
23+
24+
# List stdlib-fpm package contents
25+
ls -R "$destdir"

0 commit comments

Comments
 (0)