-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (131 loc) · 4.48 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Tests
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
inputs: {}
schedule:
# Weekly on Monday at 12:00 PM UTC
- cron: "0 12 * * 1"
env:
FORCE_COLOR: "1"
# renovate: datasource=pypi depName=schemathesis
SCHEMATHESIS_VERSION: "3.39.9"
# renovate: datasource=pypi depName=uv
UV_VERSION: "0.5.29"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
get-hub-data:
name: Get Hub Data
runs-on: ubuntu-24.04
continue-on-error: false
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
- uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2
with:
version: ${{ env.UV_VERSION }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: meltano/hub
ref: main
path: meltano-hub
- run: uv run python -I build.py meltano-hub/_data
env:
ONLY_GROUP: build
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: hub-data
path: plugins.db
tests:
name: Test
runs-on: ubuntu-24.04
continue-on-error: false
needs: [get-hub-data]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
- uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2
with:
version: ${{ env.UV_VERSION }}
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: hub-data
- run: uv run coverage run -m pytest -v
continue-on-error: true # Continue on error to combine coverage.
env:
ONLY_GROUP: tests
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
include-hidden-files: true
name: coverage
path: .coverage.*
typing:
name: Type Checking
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
- uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2
with:
version: ${{ env.UV_VERSION }}
- run: uv run mypy src tests
env:
ONLY_GROUP: typing
schemathesis:
name: Schemathesis Test
runs-on: ubuntu-24.04
needs: [get-hub-data]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: hub-data
- name: Start containers
run: docker compose up -d --build
- uses: schemathesis/action@e8c36caf1285d9c955e282cf71793837f92308a4 # v1.0.4
with:
schema: 'http://127.0.0.1:8000/openapi.json'
base-url: http://127.0.0.1:8000
api-name: meltano-hub-api
report: 'false'
args: '--experimental=openapi-3.1 --junit-xml=junit.xml'
version: ${{ env.SCHEMATHESIS_VERSION }}
- uses: mikepenz/action-junit-report@ee6b445351cd81e2f73a16a0e52d598aeac2197f # v5.3.0
if: success() || failure() # always run even if the previous step fails
with:
report_paths: junit.xml
- name: Stop containers
if: always()
run: docker compose down
coverage:
name: Coverage
runs-on: ubuntu-24.04
continue-on-error: false
needs: [tests]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: coverage
- uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2
with:
version: ${{ env.UV_VERSION }}
- name: Combine coverage
env:
ONLY_GROUP: tests
run: |
uv run coverage combine
uv run coverage html --skip-covered --skip-empty
# Report and write to summary.
uv run coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
# Report again and fail if under 100%.
uv run coverage report --fail-under=100 --show-missing
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
if: failure()
with:
name: html-report
path: htmlcov