-
Notifications
You must be signed in to change notification settings - Fork 27
66 lines (61 loc) · 2.05 KB
/
testing.yml
File metadata and controls
66 lines (61 loc) · 2.05 KB
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
name: Testing
on:
push:
branches:
- main
- dev
pull_request:
permissions:
contents: write
pull-requests: write
jobs:
unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv sync --extra dev
- run: uv run pytest --cov-report term --cov-report html --cov-report xml --cov=src/libkernelbot -m "not integration" tests -v
- uses: actions/upload-artifact@v4
with:
name: coverage
path: htmlcov/
- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v4
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
name: python-coverage-comment-action
path: python-coverage-comment-action.txt
integration-tests-modal:
runs-on: ubuntu-latest
timeout-minutes: 30
# Skip for Dependabot PRs as they don't have access to secrets
if: github.actor != 'dependabot[bot]'
env:
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv sync --extra dev
- run: uv run modal token set --token-id ${MODAL_TOKEN_ID} --token-secret ${MODAL_TOKEN_SECRET}
- run: uv run pytest -m integration tests/test_modal.py -v
integration-tests-github:
runs-on: ubuntu-latest
timeout-minutes: 45
# Skip for Dependabot PRs as they don't have access to secrets
if: github.actor != 'dependabot[bot]'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv sync --extra dev
- run: uv run pytest -m integration tests/test_github.py -v