Repository navigation
90 lines (85 loc) · 2.7 KB
/
Copy pathtest.yml
File metadata and controls
90 lines (85 loc) · 2.7 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: { }
jobs:
test:
name: Test Python code
runs-on: ubuntu-latest
env:
# add API token to `CODACY_PROJECT_TOKEN` action secrets
# NOTE: secrets aren't available to Dependabot or fork pull requests
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/preparation
- name: Test
run: uv run pytest
- name: Attach Coverage Report
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: coverage-report
path: htmlcov
- name: Generate XML Coverage Report
if: env.CODACY_PROJECT_TOKEN != ''
run: uv run coverage xml
- name: Submit Coverage Report
if: env.CODACY_PROJECT_TOKEN != ''
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml
smoke-test:
name: Smoke test Python code
runs-on: ubuntu-latest
services:
redis:
image: docker.io/redis:8
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/preparation
- name: Smoke test
run: uv run python tests/smoke_test_rq.py
- name: Test greeting example
working-directory: examples/greeting
run: |
set -o pipefail
./example
./worker --burst 2>&1 | tee "$RUNNER_TEMP/worker.log"
# the completion job only runs once every task has succeeded
grep -q "Successfully completed tasktronaut.backend.Backend.perform_complete" "$RUNNER_TEMP/worker.log"
build:
name: Test Python package build
runs-on: ubuntu-latest
needs:
- test
- smoke-test
services:
redis:
image: docker.io/redis:8
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/preparation
- name: Build
run: uv build
- name: Smoke test (wheel)
run: uv run --isolated --with dist/*.whl tests/smoke_test_rq.py
- name: Smoke test (source distribution)
run: uv run --isolated --with dist/*.tar.gz tests/smoke_test_rq.py