Skip to content

Commit 37aa2bb

Browse files
committed
add actions to make branches for various kind combinations
1 parent 3d0243e commit 37aa2bb

File tree

4 files changed

+113
-15
lines changed

4 files changed

+113
-15
lines changed

.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ codecov.yml export-ignore
3131
.github export-ignore
3232

3333
# Perform substitutions when `git export`ing these files
34-
.VERSION export-subst
34+
.VERSION export-subst
35+
36+
.github/workflows/fpm-deployment.yml
37+
.github/workflows/sync.yml

.github/workflows/fpm-deployment.yml

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,28 @@ jobs:
3838
- run: | # Just for deployment: create stdlib-fpm folder
3939
python config/fypp_deployment.py --deploy_stdlib_fpm
4040
41+
- run: | # Just for deployment: create stdlib-fpm-xdp folder
42+
python config/fypp_deployment.py --deploy_stdlib_fpm --with_xdp
43+
44+
- run: | # Just for deployment: create stdlib-fpm-qp folder
45+
python config/fypp_deployment.py --deploy_stdlib_fpm --with_qp
46+
47+
- run: | # Just for deployment: create stdlib-fpm-xdp-qp folder
48+
python config/fypp_deployment.py --deploy_stdlib_fpm --with_xdp --with_qp
49+
4150
- run: | # Just for deployment: create stdlib-fpm-ilp64 folder
4251
python config/fypp_deployment.py --deploy_stdlib_fpm --with_ilp64
4352
44-
- run: | # Use fpm gnu ci to check xdp and qp
53+
- run: | # Just for deployment: create stdlib-fpm-ilp64-xdp folder
54+
python config/fypp_deployment.py --deploy_stdlib_fpm --with_ilp64 --with_xdp
55+
56+
- run: | # Just for deployment: create stdlib-fpm-ilp64-qp folder
57+
python config/fypp_deployment.py --deploy_stdlib_fpm --with_ilp64 --with_qp
58+
59+
- run: | # Just for deployment: create stdlib-fpm-ilp64-xdp-qp folder
60+
python config/fypp_deployment.py --deploy_stdlib_fpm --with_ilp64 --with_xdp --with_qp
61+
62+
- run: | # Use fpm gnu ci to check xdp and qp
4563
python config/fypp_deployment.py --with_xdp --with_qp
4664
fpm test --profile release --flag '-DWITH_XDP -DWITH_QP'
4765
@@ -53,10 +71,58 @@ jobs:
5371
BRANCH: stdlib-fpm
5472
FOLDER: stdlib-fpm
5573

74+
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-xdp` branch.
75+
- name: Deploy with xdp support 🚀
76+
uses: JamesIves/github-pages-deploy-action@4.1.5
77+
if: github.event_name != 'pull_request'
78+
with:
79+
BRANCH: stdlib-fpm-xdp
80+
FOLDER: stdlib-fpm-xdp
81+
82+
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-qp` branch.
83+
- name: Deploy with qp support 🚀
84+
uses: JamesIves/github-pages-deploy-action@4.1.5
85+
if: github.event_name != 'pull_request'
86+
with:
87+
BRANCH: stdlib-fpm-qp
88+
FOLDER: stdlib-fpm-qp
89+
90+
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-xdp-qp` branch.
91+
- name: Deploy with xdp and qp support 🚀
92+
uses: JamesIves/github-pages-deploy-action@4.1.5
93+
if: github.event_name != 'pull_request'
94+
with:
95+
BRANCH: stdlib-fpm-xdp-qp
96+
FOLDER: stdlib-fpm-xdp-qp
97+
5698
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-ilp64` branch.
5799
- name: Deploy with 64-bit integer support 🚀
58100
uses: JamesIves/github-pages-deploy-action@4.1.5
59101
if: github.event_name != 'pull_request'
60102
with:
61103
BRANCH: stdlib-fpm-ilp64
62104
FOLDER: stdlib-fpm-ilp64
105+
106+
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-ilp64-xdp` branch.
107+
- name: Deploy with 64-bit integer and xdp support 🚀
108+
uses: JamesIves/github-pages-deploy-action@4.1.5
109+
if: github.event_name != 'pull_request'
110+
with:
111+
BRANCH: stdlib-fpm-ilp64-xdp
112+
FOLDER: stdlib-fpm-ilp64-xdp
113+
114+
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-ilp64-qp` branch.
115+
- name: Deploy with 64-bit integer and qp support 🚀
116+
uses: JamesIves/github-pages-deploy-action@4.1.5
117+
if: github.event_name != 'pull_request'
118+
with:
119+
BRANCH: stdlib-fpm-ilp64-qp
120+
FOLDER: stdlib-fpm-ilp64-qp
121+
122+
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-ilp64-xdp-qp` branch.
123+
- name: Deploy with 64-bit integer, xdp, and qp support 🚀
124+
uses: JamesIves/github-pages-deploy-action@4.1.5
125+
if: github.event_name != 'pull_request'
126+
with:
127+
BRANCH: stdlib-fpm-ilp64-xdp-qp
128+
FOLDER: stdlib-fpm-ilp64-xdp-qp

.github/workflows/sync.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: sync stdlib + enable XDP and QP
2+
3+
on:
4+
schedule:
5+
# -- m h d(m) m d(w)
6+
- cron: '0 * * * *'
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
17+
- name: fetch upstream
18+
run: |
19+
git remote add upstream https://github.com/fortran-lang/stdlib.git
20+
git fetch upstream
21+
22+
git checkout -B master upstream/master
23+
24+
- name: commit & push
25+
run: |
26+
git config user.name "github-actions[bot]"
27+
git config user.email "github-actions[bot]@users.noreply.github.com"
28+
git push --force origin master

config/fypp_deployment.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
)
1212

1313
def pre_process_fypp(args):
14-
"""use fypp to preprocess all source files.
14+
"""use fypp to preprocess all source files.
1515
1616
Processed files will be dumped at <current_folder>/temp/<file.f90> or <file.F90>
1717
1818
Parameters
1919
----------
20-
args :
20+
args :
2121
CLI arguments.
2222
"""
2323
kwd = []
@@ -51,7 +51,7 @@ def pre_process_fypp(args):
5151
fypp_files = [os.path.join(root, file) for folder in folders
5252
for root, _, files in os.walk(folder)
5353
for file in files if file.endswith(".fypp")]
54-
54+
5555
def process_f(file):
5656
source_file = file
5757
root = os.path.dirname(file)
@@ -61,25 +61,26 @@ def process_f(file):
6161
sfx = 'f90' if basename not in C_PREPROCESSED else 'F90'
6262
target_file = root+os.sep+'temp' + os.sep + basename + '.' + sfx
6363
tool.process_file(source_file, target_file)
64-
64+
6565
Parallel(n_jobs=args.njob)(delayed(process_f)(f) for f in fypp_files)
66-
66+
6767
return
6868

6969

70-
def deploy_stdlib_fpm(with_ilp64):
70+
def deploy_stdlib_fpm(with_ilp64, with_xdp, with_qp):
7171
"""create the stdlib-fpm folder for backwards compatibility (to be deprecated)
7272
"""
7373
import shutil
7474
prune=(
7575
"test_hash_functions.f90",
7676
"f18estop.f90",
7777
)
78-
79-
if with_ilp64:
80-
base_folder = 'stdlib-fpm-ilp64'
81-
else:
82-
base_folder = 'stdlib-fpm'
78+
79+
base = 'stdlib-fpm'
80+
if args.with_ilp64: base += '-ilp64'
81+
if args.with_xdp: base += '-xdp'
82+
if args.with_qp: base += '-qp'
83+
base_folder = base
8384

8485
if not os.path.exists(base_folder+os.sep+'src'):
8586
os.makedirs(base_folder+os.sep+'src')
@@ -137,7 +138,7 @@ def fpm_build(args,unknown):
137138
parser.add_argument("--with_xdp",action='store_true', help="Include WITH_XDP in the command")
138139
parser.add_argument("--with_ilp64",action='store_true', help="Include WITH_ILP64 to build 64-bit integer BLAS/LAPACK")
139140
parser.add_argument("--lnumbering",action='store_true', help="Add line numbering in preprocessed files")
140-
parser.add_argument("--deploy_stdlib_fpm",action='store_true', help="create the stdlib-fpm folder")
141+
parser.add_argument("--deploy_stdlib_fpm",action='store_true', help="create the stdlib-fpm folder")
141142
# external libraries arguments
142143
parser.add_argument("--build", action='store_true', help="Build the project")
143144

@@ -154,7 +155,7 @@ def fpm_build(args,unknown):
154155
# pre process the meta programming fypp files
155156
pre_process_fypp(args)
156157
if args.deploy_stdlib_fpm:
157-
deploy_stdlib_fpm(args.with_ilp64)
158+
deploy_stdlib_fpm(args.with_ilp64, args.with_xdp, args.with_qp)
158159
#==========================================
159160
# build using fpm
160161
if args.build:

0 commit comments

Comments
 (0)