-
-
Notifications
You must be signed in to change notification settings - Fork 315
174 lines (148 loc) · 5.19 KB
/
tests.yaml
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
## Run the Taskwarrior tests, using stable rust to build TaskChampion.
name: tests
on: [push, pull_request]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Install apt packages
run: sudo apt-get install -y build-essential cmake git uuid-dev faketime locales python3 curl gcovr ninja-build
- name: Check out this repository
uses: actions/[email protected]
- name: Configure project
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=--coverage
- name: Build project
run: cmake --build build --target test_runner --target task_executable
- name: Test project
run: ctest --test-dir build -j 8 --output-on-failure
- name: Generate a code coverage report
uses: threeal/[email protected]
with:
coveralls-out: coverage.coveralls.json
excludes: |
build
- name: Sent to Coveralls
uses: coverallsapp/github-action@v2
with:
file: coverage.coveralls.json
# MacOS tests do not run in Docker, and use the actions-rs Rust installaction
tests-macos-12:
needs: coverage
name: tests (Mac OS 12.latest)
if: false # see #3242
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-stable-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-stable-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: "stable"
override: true
- name: Test MacOS
run: bash test/scripts/test_macos.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tests-macos-13:
needs: coverage
name: tests (Mac OS 13.latest)
if: false # see #3242
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-stable-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-stable-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: "stable"
override: true
- name: Test MacOS
run: bash test/scripts/test_macos.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
cargo-test:
runs-on: ubuntu-latest
name: "Cargo Test"
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
# If this version is old enough to cause errors, or older than the
# TaskChampion MSRV, bump it to the MSRV of the currently-required
# TaskChampion package; if necessary, bump that version as well.
# This should match the MSRV in `src/taskchampion-cpp/Cargo.toml`.
toolchain: "1.73.0" # MSRV
override: true
- uses: actions-rs/[email protected]
with:
command: test
tests:
needs: coverage
strategy:
fail-fast: false
matrix:
include:
- name: "Fedora 40"
runner: ubuntu-latest
dockerfile: fedora40
- name: "Fedora 41"
runner: ubuntu-latest
dockerfile: fedora41
- name: "Debian Testing"
runner: ubuntu-latest
dockerfile: debiantesting
- name: "Ubuntu 20.04"
runner: ubuntu-latest
dockerfile: ubuntu2004
- name: "Ubuntu 22.04"
runner: ubuntu-latest
dockerfile: ubuntu2204
- name: "OpenSUSE Tumbleweed (Rolling)"
runner: ubuntu-latest
dockerfile: opensuse
- name: "Archlinux Base (Rolling)"
runner: ubuntu-latest
dockerfile: arch
runs-on: ${{ matrix.runner }}
continue-on-error: ${{ matrix.continue-on-error == true }}
steps:
- uses: actions/checkout@v4
- name: Build ${{ matrix.name }}
env:
DOCKER_REGISTRY: docker.pkg.github.com
DOCKER_CACHE_IMAGE: docker.pkg.github.com/${{ github.repository }}/taskwarrior_cache
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONTAINER: ${{ matrix.dockerfile }}
run: docker compose build test-${{ env.CONTAINER }}
- name: Test ${{ matrix.name }}
run: docker compose run test-${{ env.CONTAINER }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONTAINER: ${{ matrix.dockerfile }}