audio streaming app
plyr.fm
1name: integration tests
2
3on:
4 # run after staging deployment completes
5 workflow_run:
6 workflows: ["deploy staging"]
7 types:
8 - completed
9 branches:
10 - main
11
12 # allow manual trigger
13 workflow_dispatch:
14 inputs:
15 skip_if_no_tokens:
16 description: "Skip tests if tokens not configured (vs fail)"
17 type: boolean
18 default: true
19
20permissions:
21 contents: read
22
23jobs:
24 integration:
25 name: run integration tests
26 runs-on: ubuntu-latest
27 # only run if staging deploy succeeded (or manual trigger)
28 if: >
29 github.event_name == 'workflow_dispatch' ||
30 github.event.workflow_run.conclusion == 'success'
31 timeout-minutes: 15
32 steps:
33 - uses: actions/checkout@v4
34
35 - name: check token configuration
36 id: check-tokens
37 run: |
38 if [ -z "${{ secrets.PLYR_TEST_TOKEN_1 }}" ]; then
39 echo "has_tokens=false" >> $GITHUB_OUTPUT
40 echo "::warning::PLYR_TEST_TOKEN_1 not configured - integration tests will be skipped"
41 else
42 echo "has_tokens=true" >> $GITHUB_OUTPUT
43 fi
44
45 - name: set up python
46 if: steps.check-tokens.outputs.has_tokens == 'true'
47 uses: actions/setup-python@v5
48 with:
49 python-version: "3.12"
50
51 - name: install uv
52 if: steps.check-tokens.outputs.has_tokens == 'true'
53 uses: astral-sh/setup-uv@v7
54 with:
55 enable-cache: true
56 cache-dependency-glob: "backend/uv.lock"
57
58 - name: install dependencies
59 if: steps.check-tokens.outputs.has_tokens == 'true'
60 run: cd backend && uv sync --locked
61
62 - name: install ffmpeg
63 if: steps.check-tokens.outputs.has_tokens == 'true'
64 run: sudo apt-get update && sudo apt-get install -y ffmpeg
65
66 - name: run integration tests
67 if: steps.check-tokens.outputs.has_tokens == 'true'
68 env:
69 PLYR_API_URL: https://api-stg.plyr.fm
70 PLYR_TEST_TOKEN_1: ${{ secrets.PLYR_TEST_TOKEN_1 }}
71 PLYR_TEST_TOKEN_2: ${{ secrets.PLYR_TEST_TOKEN_2 }}
72 PLYR_TEST_TOKEN_3: ${{ secrets.PLYR_TEST_TOKEN_3 }}
73 run: |
74 cd backend
75 uv run pytest tests/integration -m integration -v --tb=short
76
77 - name: prune uv cache
78 if: always()
79 run: uv cache prune --ci