-
Notifications
You must be signed in to change notification settings - Fork 48
62 lines (53 loc) · 1.72 KB
/
update-op2-apps.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
60
61
62
name: update-op2-apps
on:
push:
paths:
- 'apps/**'
- 'translator/**'
- 'makefiles/*_app.mk'
- '.github/workflows/update-op2-apps.yml'
branches:
- 'master'
jobs:
update-op2-apps:
runs-on: ubuntu-latest
steps:
- name: Install MPI
run: sudo apt update && sudo apt install -y libopenmpi-dev
- name: Checkout
uses: actions/checkout@v2
with:
path: OP2-Common
- name: Checkout OP2-APPS
uses: actions/checkout@v2
with:
repository: OP-DSL/OP2-APPS
path: OP2-APPS
token: ${{ secrets.OP2_APPS_TOKEN }}
- name: Install Python deps
working-directory: OP2-Common/translator-v2
run: pip3 install -r requirements.txt
- name: Configure
working-directory: OP2-Common/op2
run: |
make config
- name: Translate apps
run: |
FILES=$(find OP2-Common/apps -name Makefile | xargs grep -l 'include.*[cf]_app.mk')
export MPI_INC=/usr/lib/x86_64-linux-gnu/openmpi/include
for file in $FILES; do make -C $(dirname $file) generate; done
- name: Update OP2-APPS
run: |
rsync -a --exclude='.gitignore' --delete OP2-Common/apps/ OP2-APPS/apps/
- name: Configure git name and email
working-directory: OP2-APPS
run: |
git config user.name 'opdslapps'
git config user.email '<>'
- name: Commit and push OP2-APPS
working-directory: OP2-APPS
run: |
COMMIT_MSG=$(git --git-dir ../OP2-Common/.git log -n 1 --pretty=format:"%h %s" $GITHUB_SHA)
git add .
git commit -m "Track \"$COMMIT_MSG\"" || true
git push