Repository navigation
101 lines (92 loc) · 2.96 KB
/
Copy pathtest.yml
File metadata and controls
101 lines (92 loc) · 2.96 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
91
92
93
94
95
96
97
98
99
100
101
name: Test
# Top-level test entry point for tag pushes and manual reruns. Builds the SDK
# once, then fans out to _unit-test.yml (test-go, test-python, test-sdk-ci) and
# _qdc-test.yml (test-sdk-qdc). Tag pushes get the same coverage as PR check.
#
# Independent of release.yml: both fire on the same tag push as siblings —
# failures here surface on the tag commit and never gate release.yml's
# publish-* jobs.
#
# pr-check.yml calls _unit-test.yml / _qdc-test.yml directly so it can share
# its own build-sdk artifact instead of triggering this workflow.
on:
push:
tags:
# Coarse glob; the `gate` job below applies a SemVer regex so alpha /
# dev / feature-branch v-tags don't trigger the full test matrix.
# Mirrors release.yml.
- "v*"
workflow_dispatch:
inputs:
version_tag:
description: "Explicit version tag (passed to build-sdk on workflow_dispatch)."
required: false
type: string
default: ""
permissions:
contents: read
packages: read
jobs:
gate:
runs-on: ubuntu-latest
timeout-minutes: 1
outputs:
run: ${{ steps.decide.outputs.run }}
steps:
- id: decide
env:
EVENT: ${{ github.event_name }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
if [ "$EVENT" != "push" ]; then
echo "run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if [[ "$TAG" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-rc\.(0|[1-9][0-9]*))?$ ]]; then
echo "run=true" >> "$GITHUB_OUTPUT"
else
echo "::notice::Tag $TAG is not a release / rc tag; skipping test.yml"
echo "run=false" >> "$GITHUB_OUTPUT"
fi
build-sdk:
needs: [gate]
if: needs.gate.outputs.run == 'true'
uses: ./.github/workflows/_build-sdk.yml
secrets: inherit
with:
upload_artifact: true
version_tag: ${{ inputs.version_tag || github.ref_name }}
test-go:
needs: [build-sdk]
if: ${{ !cancelled() && needs.build-sdk.result == 'success' }}
uses: ./.github/workflows/_unit-test.yml
secrets: inherit
with:
language: go
gate_on_changed_files: false
test-python:
needs: [build-sdk]
if: ${{ !cancelled() && needs.build-sdk.result == 'success' }}
uses: ./.github/workflows/_unit-test.yml
secrets: inherit
with:
language: python
gate_on_changed_files: false
test-sdk-ci:
needs: [build-sdk]
if: ${{ !cancelled() && needs.build-sdk.result == 'success' }}
uses: ./.github/workflows/_unit-test.yml
secrets: inherit
with:
language: sdk
# Linux disabled until the llama_cpp plugin can load without OpenCL.
platforms: '["windows-arm64"]'
gate_on_changed_files: false
test-sdk-qdc:
needs: [build-sdk]
if: ${{ !cancelled() && needs.build-sdk.result == 'success' }}
uses: ./.github/workflows/_qdc-test.yml
secrets: inherit
with:
gate_on_changed_files: false