-
-
Notifications
You must be signed in to change notification settings - Fork 25
141 lines (128 loc) · 5.25 KB
/
test.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Build & Test
on:
push:
branches: [master]
paths: ['**.rs', '**.toml', '**.yml']
pull_request:
branches: [master, next]
paths: ['**.rs', '**.toml', '**.yml']
schedule:
- cron: '0 0 1 * *' # Run at the start of the 1st day of every month
jobs:
# NOTE: I'm leaving this with no descriptive name so it is not too long in the list of jobs.
# Previously I assigned a name of "Check building & testing" which resulted in entries like:
# "Check building & testing (ubuntu-20.04, stable, false)" and "stable" was barely visible.
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
# Use the Ubuntu Focal (20.04) environment, which uses PA v13.99.1
os: [ubuntu-22.04]
rustc:
- 1.70.0 # Overall MSRV (Minimum supported rust version), including glib's requirement
- stable
- beta
# Allow failure?
experimental: [false]
# Skip running unit tests?
skip-unit-tests: [false]
# Skip compiling the glib-related crate? (Used when it has higher MSRV than us)
skip-glib-crate: [false]
include:
# Nightly test - must be allowed to fail
- os: ubuntu-22.04
rustc: nightly
experimental: true
skip-unit-tests: false
skip-glib-crate: false
# Minimal MSRV test - Our actual MSRV, excluding glib crate (often needs newer version)
- os: ubuntu-22.04
rustc: 1.56.0
experimental: false
skip-unit-tests: true
skip-glib-crate: true
env:
# Version feature flags to test with `cargo check`
#
PA_BUILD_VERSIONS: "pa_v15 pa_v14 pa_v13 pa_v12 pa_v8 pa_v6"
# Single feature flag to use for `cargo test` steps
PA_TEST_VERSION: pa_v15
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install toolchain
run: |
rustup toolchain install ${{ matrix.rustc }} --profile minimal --no-self-update
rustup default ${{ matrix.rustc }}
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
echo RUST_BACKTRACE=1 >> $GITHUB_ENV
rustc -V
cargo -V
- name: Install PulseAudio and `libpulse-dev`
run: |
sudo apt-get update
sudo apt-get install pulseaudio libpulse-mainloop-glib0 libpulse-dev
- name: Start PulseAudio
run: |
systemctl --user start pulseaudio
systemctl --user status pulseaudio
- name: Check building main binding (cargo check)
working-directory: ./pulse-binding
run: |
for PA_VERSION in $PA_BUILD_VERSIONS; do
echo "::group::${PA_VERSION}"
echo "Building with version feature flag '${PA_VERSION}'"
cargo check --verbose --no-default-features --features $PA_VERSION
echo "::endgroup::"
done
echo "::group::no-features"
echo "Building with no version feature flag and no-default-features"
cargo check --verbose --no-default-features
echo "::endgroup::"
- name: Check building simple binding (cargo check)
working-directory: ./pulse-binding-simple
run: |
for PA_VERSION in $PA_BUILD_VERSIONS; do
echo "::group::${PA_VERSION}"
echo "Building with version feature flag '${PA_VERSION}'"
cargo check --verbose --no-default-features --features $PA_VERSION
echo "::endgroup::"
done
echo "::group::no-features"
echo "Building with no version feature flag and no-default-features"
cargo check --verbose --no-default-features
echo "::endgroup::"
- name: Check building glib binding (cargo check)
if: ${{ matrix.skip-glib-crate == false }}
working-directory: ./pulse-binding-mainloop-glib
run: |
for PA_VERSION in $PA_BUILD_VERSIONS; do
echo "::group::${PA_VERSION}"
echo "Building with version feature flag '${PA_VERSION}'"
cargo check --verbose --no-default-features --features $PA_VERSION
echo "::endgroup::"
done
echo "::group::no-features"
echo "Building with no version feature flag and no-default-features"
cargo check --verbose --no-default-features
echo "::endgroup::"
- name: Test main binding
if: ${{ matrix.skip-unit-tests == false }}
working-directory: ./pulse-binding
run: |
echo "Testing with version feature flag '${PA_TEST_VERSION}'"
cargo test --verbose --features $PA_TEST_VERSION
- name: Test simple binding
if: ${{ matrix.skip-unit-tests == false }}
working-directory: ./pulse-binding-simple
run: |
echo "Testing with version feature flag '${PA_TEST_VERSION}'"
cargo test --verbose --features $PA_TEST_VERSION
- name: Test glib binding
if: ${{ matrix.skip-unit-tests == false && matrix.skip-glib-crate == false }}
working-directory: ./pulse-binding-mainloop-glib
run: |
echo "Testing with version feature flag '${PA_TEST_VERSION}'"
cargo test --verbose --features $PA_TEST_VERSION