-
-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (63 loc) · 2.07 KB
/
tests.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
name: Tests
on:
push:
branches:
- develop
pull_request: ~
jobs:
versions:
runs-on: ubuntu-latest
outputs:
server_versions: ${{ steps.set-server-versions.outputs.server_versions }}
python_versions: ${{ steps.set-python-versions.outputs.python_versions }}
steps:
- uses: actions/checkout@v4
- id: set-server-versions
run: echo "server_versions=$(cat tautulli/API_VERSIONS.json | jq -c '')" >> $GITHUB_OUTPUT
- id: set-python-versions
run: echo "python_versions=$(cat tautulli/PYTHON_VERSIONS.json | jq -c '')" >> $GITHUB_OUTPUT
unit-tests:
needs: versions
runs-on: ubuntu-latest
strategy:
matrix:
image_version: ${{ fromJson(needs.versions.outputs.server_versions) }}
python_version: ${{ fromJson(needs.versions.outputs.python_versions) }}
services:
tautulli-docker:
image: tautulli/tautulli:v${{ matrix.image_version }}
ports:
- 8001:8181
continue-on-error: true # Continue running tests (some Docker images will fail to pull)
steps:
- name: Matrix => (${{ matrix.image_version }} ${{ matrix.python_version}})
run: |
echo ${{ matrix.image_version }}
echo ${{ matrix.python_version }}
- name: Sleep for 30 seconds
uses: jakejarvis/wait-action@master
with:
time: '30s'
- name: Checkout code
uses: actions/checkout@v4
- name: Replace version stand-in
uses: jacobtomlinson/[email protected]
with:
find: "VERSIONADDEDBYGITHUB"
replace: "1000.0.0"
regex: false
- name: Make envfile
uses: SpicyPizza/create-envfile@v1
with:
envkey_T_URL: http://localhost:8001
file_name: .env
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
make install
- name: Test with pytest
run: make test