-
Notifications
You must be signed in to change notification settings - Fork 66
76 lines (67 loc) · 2.28 KB
/
staging-tests.yaml
File metadata and controls
76 lines (67 loc) · 2.28 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
name: Staging tests
on:
pull_request:
types: [labeled]
branches:
- master
- 'rel/**'
issue_comment:
types: [created]
workflow_dispatch:
inputs:
test_envs:
description: 'Tox test environments to run (e.g. py312)'
required: false
default: 'py314'
test_filter:
description: 'Pytest filter expression (-k flag)'
required: false
default: ''
concurrency:
group: staging-tests
cancel-in-progress: false
jobs:
staging-tests:
name: Staging tests
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && github.event.label.name == 'test-staging') ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '/test-staging'))
runs-on:
group: infra1-runners-arc
labels: runners-small
steps:
- name: Get PR head SHA (comment trigger)
if: github.event_name == 'issue_comment'
id: pr
run: |
PR_DATA=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.issue.number }})
echo "sha=$(echo "$PR_DATA" | jq -r .head.sha)" >> "$GITHUB_OUTPUT"
echo "ref=$(echo "$PR_DATA" | jq -r .head.ref)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ steps.pr.outputs.sha || github.event.pull_request.head.sha || github.sha }}
- name: Set up Python
uses: astral-sh/setup-uv@v7
with:
python-version: '3.14'
- name: Install dependencies
run: uv sync --group test --locked
- name: Clean staging environment
run: make clean-staging
env:
TOKEN: ${{ secrets.PYTHON_SDK_STG_API_KEY }}
- name: Load staging environment
run: make load-staging
env:
TOKEN: ${{ secrets.PYTHON_SDK_STG_API_KEY }}
- name: Run staging tests
run: |
make test-staging \
TEST_ENVS=${{ github.event.inputs.test_envs || 'py314' }} \
ADD_ARGS="${{ github.event.inputs.test_filter && format('-k {0}', github.event.inputs.test_filter) || '' }}"
env:
TOKEN: ${{ secrets.PYTHON_SDK_STG_API_KEY }}