@@ -2,16 +2,22 @@ name: CI
22
33# Controls when the action will run.
44on :
5- push :
6- branches : [ main, '*-devel' ]
75 pull_request :
8- branches : [ main, '*-devel' ]
6+ branches :
7+ - main
8+ - ' *-devel'
9+ pull_request_review :
10+ branches :
11+ - main
12+ - ' *-devel'
913
1014 # Allows you to run this workflow manually from the Actions tab
1115 workflow_dispatch :
1216
1317jobs :
1418 build_and_test :
19+ if : github.event_name != 'pull_request_review' ||
20+ contains(github.event.pull_request.labels.*.name, 'auto-pr')
1521 # The type of runner that the job will run on
1622 runs-on : ubuntu-20.04
1723 strategy :
@@ -37,36 +43,38 @@ jobs:
3743 MPIPROCS : 2
3844 MODE : ${{ matrix.mode }}
3945 DEFINE : ${{ matrix.define }}
46+ GH_BASE : ${{ github.event.pull_request.base.ref }}
47+ GH_HEAD : ${{ github.event.pull_request.head.ref }}
48+ GH_SHA : ${{ github.event.pull_request.head.sha }}
4049
4150 steps :
42- - name : Install dependencies
43- run : sudo apt update &&
44- sudo apt install -y
45- python3-dev
46- python3-numpy
47- python3-nose
48- python3-matplotlib
49- libpython3-dev
50- mpich
51+ - name : Install dependencies
52+ run : sudo apt update &&
53+ sudo apt install -y
54+ python3-dev
55+ python3-numpy
56+ python3-nose
57+ python3-matplotlib
58+ libpython3-dev
59+ mpich
5160
52- - name : Checkout code
53- uses : actions/checkout@v2
54- with :
55- submodules : recursive
56- fetch-depth : 0
61+ - name : Checkout code
62+ uses : actions/checkout@v2
63+ with :
64+ submodules : recursive
65+ fetch-depth : 0
5766
58- - name : Merge branch
59- if : github.event_name == 'pull_request'
60- run : git config user.email "test@example.com" &&
61- git config user.name "test" &&
62- git checkout -b $GITHUB_HEAD_REF $GITHUB_SHA &&
63- git checkout -b $GITHUB_BASE_REF origin/$GITHUB_BASE_REF &&
64- git merge --no-ff $GITHUB_HEAD_REF
67+ - name : Merge branch
68+ run : git config user.email "test@example.com" &&
69+ git config user.name "test" &&
70+ git checkout -b $GH_HEAD $GH_SHA &&
71+ git checkout -b $GH_BASE origin/$GH_BASE &&
72+ git merge --no-ff $GH_HEAD
6573
66- - name : Cleanup
67- run : cd epoch1d && make cleanall &&
68- cd ../epoch2d && make cleanall &&
69- cd ../epoch3d && make cleanall
74+ - name : Cleanup
75+ run : cd epoch1d && make cleanall &&
76+ cd ../epoch2d && make cleanall &&
77+ cd ../epoch3d && make cleanall
7078
71- - name : Compile and run tests
72- run : ./scripts/run-tests-epoch-all.sh ${{ matrix.flag }}
79+ - name : Compile and run tests
80+ run : ./scripts/run-tests-epoch-all.sh ${{ matrix.flag }}
0 commit comments