-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (55 loc) · 1.54 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: CI
on:
push:
branches:
- main
paths:
- include/**
- src/**
workflow_dispatch:
jobs:
main:
name: Create branch 2D and 3D which only contains the dimension and compile each
permissions:
contents: write
strategy:
matrix:
dimension: [2, 3]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
repository: "NaokiHori/SimpleBubblyFlowSolver"
ref: "main"
submodules: "recursive"
- name: Install dependencies
run: |
sudo apt-get -y update && \
sudo apt-get -y install make libopenmpi-dev libfftw3-dev
- name: Remove another dimension
run: |
set -x
set -e
python .github/workflows/extract_nd.py ${{ matrix.dimension }}
- name: Modify Makefile
run: |
set -x
set -e
sed -i "s/DNDIMS=2/DNDIMS=${{ matrix.dimension }}/g" Makefile
- name: Compile
run: |
make all
- name: Commit and push change
run: |
set -x
set -e
git switch -c ${{ matrix.dimension }}d
git config --local user.email "36466440+NaokiHori@users.noreply.github.com"
git config --local user.name "NaokiHori"
# add, commit, and push
git add Makefile
git add src
git add include
git commit -m "Extract ${{ matrix.dimension }}d sources" -a || true
git push -f origin ${{ matrix.dimension }}d