-
Notifications
You must be signed in to change notification settings - Fork 3
153 lines (150 loc) · 4.97 KB
/
test_suite.yml
File metadata and controls
153 lines (150 loc) · 4.97 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
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
142
143
144
145
146
147
148
149
150
151
152
153
name: "Test Suite"
on:
push:
branches: [main, "release/*"]
pull_request:
branches: [main, "release/*"]
types: [labeled, synchronize]
workflow_dispatch:
inputs:
overwrite_baseline:
description: >
Overwrite baseline results? This will make the test suite succeed even if a regression is detected.
required: true
default: "false"
type: choice
options:
- "true"
- "false"
permissions:
contents: read
packages: write
issues: read
checks: write
pull-requests: write
actions: write
defaults:
run:
shell: bash -l {0}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'main/')}}
# we want concurrent jobs on main
env:
CONTAINER_NAME: nvidia/cuda:12.9.0-cudnn-devel-ubuntu24.04
jobs:
test_suite:
if: ${{ github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ready')) }}
runs-on: [self-hosted, AxA6000]
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: "recursive"
- name: "Run test image"
run: |
docker run -d \
--gpus "\"device=${NVIDIA_VISIBLE_DEVICES}\"" \
--shm-size=12gb \
--cpus=24 \
--name setu-testsuite-${{ github.run_id }} \
-w /repo \
-v "${{ github.workspace }}:/repo" \
$CONTAINER_NAME sleep infinity
- name: "Setup build environment"
run: |
docker exec \
setu-testsuite-${{ github.run_id }} \
bash /repo/scripts/containers/dev/setup_env.sh
- name: "Build setu"
id: build_setu
run: |
docker exec \
-e SETU_IS_CI_CONTEXT="true" \
setu-testsuite-${{ github.run_id }} \
make build
- name: "Run pyright"
id: run_pyright
run: |
docker exec \
-e SETU_IS_CI_CONTEXT="true" \
-e HUGGINGFACE_TOKEN="${{ secrets.HUGGINGFACE_TOKEN }}" \
setu-testsuite-${{ github.run_id }} \
make lint/pyright
- name: "Run all unit tests"
id: run_unit_tests
run: |
docker exec \
-e SETU_IS_CI_CONTEXT="true" \
-e HUGGINGFACE_TOKEN="${{ secrets.HUGGINGFACE_TOKEN }}" \
setu-testsuite-${{ github.run_id }} \
make test/unit
- name: "Run all integration tests"
id: run_integration_tests
run: |
docker exec \
-e SETU_IS_CI_CONTEXT="true" \
-e HUGGINGFACE_TOKEN="${{ secrets.HUGGINGFACE_TOKEN }}" \
setu-testsuite-${{ github.run_id }} \
make test/integration
- name: "Run functional tests"
id: run_functional_tests
run: |
docker exec \
-e SETU_IS_CI_CONTEXT="true" \
-e GITHUB_RUN_ID="${{ github.run_id }}" \
-e GITHUB_SHA="${{ github.sha }}" \
-e BASELINE_BRANCH="main" \
-e GITHUB_TOKEN="${{ github.token }}" \
-e GITHUB_REPOSITORY="${{ github.repository }}" \
-e HUGGINGFACE_TOKEN="${{ secrets.HUGGINGFACE_TOKEN }}" \
-e BASELINE_WORKFLOW_FILENAME="test_suite" \
-e BASELINE_WORKFLOW_NAME="Test Suite" \
-e OVERWRITE_BASELINE="${{ inputs.overwrite_baseline }}" \
setu-testsuite-${{ github.run_id }} \
make test/functional
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: always()
with:
report_paths: "test_reports/*-results.xml"
comment: true
include_passed: true
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
if: always()
with:
filename: test_reports/**_coverage.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: "10 30"
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
- name: "Stop Docker container"
id: stop_docker_container
if: always()
run: |
docker stop setu-testsuite-${{ github.run_id }}
docker rm setu-testsuite-${{ github.run_id }}
- name: Notify on Discord
if: failure() && github.ref == 'refs/heads/main'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: |
❌ Functional test suite failed on main branch!
• Commit: ${{ github.sha }}
• Run:
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
This needs immediate attention.