-
-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (59 loc) · 2.08 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
66
67
68
name: Run Tests
on:
push:
branches:
- '**'
pull_request:
jobs:
run:
runs-on: ubuntu-20.04
strategy:
max-parallel: 1
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Requirements
run: |
python -c "import sys; print(sys.version)"
pip install -r requirements.txt
pip install -r requirements-dev.txt
python setup.py install
- name: Run Tests
env:
TMDB_APIKEY: ${{ secrets.TMDB_APIKEY }}
TMDB_SESSION: ${{ secrets.TMDB_SESSION }}
TMDB_V4_ACCESS: ${{ secrets.TMDB_V4_ACCESS }}
TMDB_V4_TOKEN: ${{ secrets.TMDB_V4_TOKEN }}
TMDB_USERNAME: ${{ secrets.TMDB_USERNAME }}
TMDB_PASSWORD: ${{ secrets.TMDB_PASSWORD }}
PAT: ${{ secrets.PAT }}
LOCAL: False
run: coverage run -m pytest -s --cov tmdbapis --cov-report xml tests/test*
- name: Codecov coverage reports
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
failure-notification:
runs-on: ubuntu-latest
if: ${{ failure() }}
needs: [run]
steps:
- name: Discord Failure Notification
uses: Kometa-Team/discord-notifications@master
with:
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
message: <@&1079153184007790652>
title: "${{ secrets.REPO_NAME }}: **Tests Failed**"
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }}
color: 14879811
username: Kobota
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png
author: GitHub
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/git.png