-
-
Notifications
You must be signed in to change notification settings - Fork 7
162 lines (153 loc) · 6.13 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
---
"on":
push:
branches: [main]
pull_request:
branches: [main]
pull_request_target:
types: [labeled]
branches: [main]
name: Test
jobs:
test_offline:
if: "!github.event.pull_request_target || github.event.pull_request_target.label.name == 'S-Run-Protected-Tests'"
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
name: Offline tests
runs-on: "${{ matrix.os }}"
steps:
- name: "Git: enable longpaths"
run: git config --global core.longpaths true
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: cache
- name: Run tests
run: cargo run --package xtask -- test --offline --github-actions
test_on_real_server_anonymous:
if: "!github.event.pull_request_target"
needs: test_offline
name: Test on a real server (anonymous)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
plex_server_version: ["1.32.8.7639-fb6452ebf","1.30.2.6563-3d4dc0cce","1.28.2.6151-914ddd2b3"]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: cache-anonymous
- name: "Test against real server [anonymous]"
run: cargo run --package xtask -- test --online --docker-tag '${{ matrix.plex_server_version }}' --deny-unknown-fields --github-actions
test_on_real_server_authenticated_free:
if: "github.event.pull_request_target.label.name == 'S-Run-Protected-Tests'"
needs: test_offline
strategy:
fail-fast: false
matrix:
plex_server_version: ["1.32.8.7639-fb6452ebf","1.30.2.6563-3d4dc0cce","1.28.2.6151-914ddd2b3"]
name: Test on a real server (authenticated free account)
runs-on: ubuntu-latest
env:
X_PLEX_CLIENT_IDENTIFIER: "${{ secrets.X_PLEX_CLIENT_IDENTIFIER_FREE }}"
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: cache-authenticated
- name: "Test against real server [authenticated]"
run: cargo run --package xtask -- test --online --docker-tag '${{ matrix.plex_server_version }}' --token '${{ secrets.PLEX_API_AUTH_TOKEN_FREE }}' --deny-unknown-fields --github-actions
test_on_real_server_authenticated_plexpass:
if: "github.event.pull_request_target.label.name == 'S-Run-Protected-Tests'"
needs: test_offline
strategy:
fail-fast: false
matrix:
plex_server_version: ["1.32.8.7639-fb6452ebf","1.30.2.6563-3d4dc0cce","1.28.2.6151-914ddd2b3"]
name: Test on a real server (authenticated plexpass account)
runs-on: ubuntu-latest
env:
X_PLEX_CLIENT_IDENTIFIER: "${{ secrets.X_PLEX_CLIENT_IDENTIFIER_PLEXPASS }}"
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: cache-authenticated
- name: "Test against real server [authenticated]"
run: cargo run --package xtask -- test --online --docker-tag '${{ matrix.plex_server_version }}' --token '${{ secrets.PLEX_API_AUTH_TOKEN_PLEXPASS }}' --deny-unknown-fields --github-actions
test_on_real_server_unclaimed_authenticated:
if: "github.event.pull_request_target.label.name == 'S-Run-Protected-Tests'"
needs: test_offline
strategy:
fail-fast: false
matrix:
plex_server_version: ["1.32.8.7639-fb6452ebf","1.30.2.6563-3d4dc0cce","1.28.2.6151-914ddd2b3"]
name: Test on a real server (unclaimed, authenticated free account)
runs-on: ubuntu-latest
env:
X_PLEX_CLIENT_IDENTIFIER: "${{ secrets.X_PLEX_CLIENT_IDENTIFIER_FREE }}"
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: cache-authenticated
- run: cargo run --package xtask -- test --online --docker-tag '${{ matrix.plex_server_version }}' --token '${{ secrets.PLEX_API_AUTH_TOKEN_FREE }}' --server-owner-token '' --deny-unknown-fields --github-actions
test_on_real_server_shared:
if: "github.event.pull_request_target.label.name == 'S-Run-Protected-Tests'"
needs: test_offline
strategy:
fail-fast: false
matrix:
plex_server_version: ["1.32.8.7639-fb6452ebf","1.30.2.6563-3d4dc0cce","1.28.2.6151-914ddd2b3"]
name: Test on a real server (authenticated free account with shared from plexpass server)
runs-on: ubuntu-latest
env:
X_PLEX_CLIENT_IDENTIFIER: "${{ secrets.X_PLEX_CLIENT_IDENTIFIER_FREE }}"
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: cache-authenticated
- run: cargo run --package xtask -- test --online --docker-tag '${{ matrix.plex_server_version }}' --token '${{ secrets.PLEX_API_AUTH_TOKEN_FREE }}' --server-owner-token '${{ secrets.PLEX_API_AUTH_TOKEN_PLEXPASS }}' --deny-unknown-fields --github-actions
collect_coverage:
if: "!github.event.pull_request_target"
name: Collect code coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate code coverage
run: |
cargo +nightly tarpaulin --workspace --timeout 120 --out xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: true