-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (70 loc) · 2.36 KB
/
Copy pathtest.yml
File metadata and controls
78 lines (70 loc) · 2.36 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
---
name: Test
on:
workflow_call:
inputs:
os: { type: string, required: true }
python-version: { type: string, required: true }
jobs:
unit:
defaults:
run:
shell: bash -e -l {0}
runs-on: ${{ inputs.os }}
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup pixi env
uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0
with:
pixi-version: "v0.69.0"
environments: test-py${{ inputs.python-version }}
locked: false
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Test
run: |
pixi run -e test-py${{ inputs.python-version }} test-cov
- name: Upload coverage
if: inputs.os == 'ubuntu-latest' && inputs.python-version == '314'
uses: actions/upload-artifact@v6
with:
name: code-coverage
path: coverage.xml
- name: Signal SonarQube
if: inputs.os == 'ubuntu-latest' && inputs.python-version == '314'
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
event-type: sonarqube-trigger
client-payload: |
{
"run_id": "${{ github.run_id }}",
"branch": "${{ github.head_ref || github.ref_name }}",
"pr_flag": "${{ github.event_name == 'pull_request' }}",
"pr_base": "${{ github.event.pull_request.base.ref || '' }}",
"pr_number": "${{ github.event.pull_request.number || '' }}"
}
# integration:
# defaults:
# run:
# shell: bash -e -l {0}
# runs-on: ${{ inputs.os }}
# needs: unit
# timeout-minutes: 30
# steps:
# - name: Checkout code
# uses: actions/checkout@v6
# - name: Setup pixi env
# uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0
# with:
# pixi-version: "v0.69.0"
# environments: test-py${{ inputs.python-version }}
# locked: false
# cache: true
# cache-write: false
# - name: Test
# run: |
# pixi run -e test-py${{ inputs.python-version }} test-integration