-
Notifications
You must be signed in to change notification settings - Fork 4
93 lines (81 loc) · 2.67 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
name: CI
on:
workflow_dispatch:
schedule:
- cron: "35 4 */6 * *" # Every 6 days.
pull_request:
push:
jobs:
build-iqtree:
name: Fetch or Build IQ-TREE 2 Static Library on ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-14] # Intel linux, Intel Mac, ARM Mac
steps:
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
submodules: recursive
- name: Get IQ-TREE 2 SHA
run: |
cd iqtree2
IQ_TREE_2_SHA=$(git rev-parse HEAD)
echo "IQ_TREE_2_SHA=${IQ_TREE_2_SHA}" >> $GITHUB_ENV
- uses: actions/cache@v4
id: cache
with:
key: libiqtree-${{ matrix.os }}-${{ env.IQ_TREE_2_SHA }}
path: src/piqtree2/_libiqtree/libiqtree2.a
lookup-only: true
- name: Build IQ-TREE
if: steps.cache.outputs.cache-hit != 'true'
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
sudo ./build_tools/before_all_linux.sh
else
./build_tools/before_all_mac.sh
fi
tests:
name: Run Tests with Python ${{matrix.python-version}} on ${{matrix.os}}
needs: build-iqtree
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-14] # Intel linux, Intel Mac, ARM Mac
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
submodules: recursive
- uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.python-version }}"
- uses: actions/cache/restore@v4
with:
key: libiqtree-${{ matrix.os }}-${{ env.IQ_TREE_2_SHA }}
path: src/piqtree2/_libiqtree/libiqtree2.a
fail-on-cache-miss: true
- name: Run Nox Testing
run: |
pip install nox
nox -s test-${{ matrix.python-version }} -- --cov --cov-report=lcov:${{matrix.os}}-${{matrix.python-version}}.lcov --cov-report=term --cov-append --durations=20
- name: Coveralls Parallel
if: matrix.os != 'macos-13'
uses: coverallsapp/github-action@v2
with:
parallel: true
github-token: ${{secrets.github_token}}
flag-name: run-${{matrix.python-version}}-${{matrix.os}}
file: "${{matrix.os}}-${{matrix.python-version}}.lcov"
finish:
name: "Finish Coveralls"
needs: tests
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true