-
Notifications
You must be signed in to change notification settings - Fork 73
127 lines (120 loc) · 4.55 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: BEAST CI
#on:
# push:
# branches:
# - main
# pull_request:
on: [push]
# Cancel if a newer run is started
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
BEAGLE_DIR: beagle-lib
BEAGLE_LIB: beagle-lib/usr/local/lib
LD_LIBRARY_PATH: beagle-lib/usr/local/lib
BEAGLE_BRANCH: v4_release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: "8"
distribution: "adopt"
- name: Setup cmake
uses: lukka/get-cmake@latest
- name: Cache BEAGLE
id: cache
uses: actions/cache@v4
with:
path: |
${{ env.BEAGLE_DIR }}
build/dist
key: beagle-beast-${{ hashFiles('**/build_beagle.sh', '**/build.xml') }}
- name: Build BEAGLE
run: |
chmod +x ./.github/scripts/build_beagle.sh
./.github/scripts/build_beagle.sh
- name: Build BEAST
run: ant dist
- name: Check BEAGLE
run: |
ls ${BEAGLE_LIB}
java -jar -Djava.library.path=${BEAGLE_LIB} build/dist/beast.jar -beagle_info
- name: Set up test matrices
id: set-matrices
run: |
echo "xml-matrix=$(ls tests/TestXML/*.xml | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
echo "xml-load-state-matrix=$(ls tests/TestXMLwithLoadState/*.xml | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
outputs:
xml-matrix: ${{ steps.set-matrices.outputs.xml-matrix }}
xml-load-state-matrix: ${{ steps.set-matrices.outputs.xml-load-state-matrix }}
test-xml:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
file: ${{fromJson(needs.build.outputs.xml-matrix)}}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
${{ env.BEAGLE_DIR }}
build/dist
key: beagle-beast-${{ hashFiles('**/build_beagle.sh', '**/build.xml') }}
restore-keys: |
beagle-beast
- name: Rebuild project
run: ant dist
- name: Run test for ${{ matrix.file }}
run: java -Djava.library.path=${BEAGLE_LIB} -jar build/dist/beast.jar -fail_threads -seed 666 -overwrite ${{ matrix.file }}
test-xml-load-state:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
file: ${{fromJson(needs.build.outputs.xml-load-state-matrix)}}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
${{ env.BEAGLE_DIR }}
build/dist
key: beagle-beast-${{ hashFiles('**/build_beagle.sh', '**/build.xml') }}
restore-keys: |
beagle-beast
- name: Rebuild project
run: ant dist
- name: Run test with load state for ${{ matrix.file }}
run: |
checkpoint=tests/TestXMLwithLoadState/$(basename ${{ matrix.file }} .xml).chkpt
java -Djava.library.path=${BEAGLE_LIB} -jar build/dist/beast.jar -fail_threads -seed 666 -load_state $checkpoint -overwrite ${{ matrix.file }}
test-junit:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: "8"
distribution: "adopt"
- uses: actions/cache@v4
with:
path: |
${{ env.BEAGLE_DIR }}
build/dist
key: beagle-beast-${{ hashFiles('**/build_beagle.sh', '**/build.xml') }}
restore-keys: |
beagle-beast
- name: Rebuild project
run: ant dist
- name: Run JUnit tests
run: |
ant -Djava.library.path=${BEAGLE_LIB} junit