forked from qdrant/qdrant
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (104 loc) · 3.81 KB
/
rust-gpu.yml
File metadata and controls
109 lines (104 loc) · 3.81 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
name: Rust GPU tests
on:
workflow_dispatch:
push:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
rust-gpu-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
steps:
- name: Install minimal stable
uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Force cmake version for 'shaderc' crate. The runner `ubuntu-latest` has cmake 4.x
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.x'
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Install Vulkan packages
run: |
sudo apt-get install clang
sudo apt-get install mesa-vulkan-drivers libvulkan1 vulkan-tools vulkan-validationlayers
/usr/bin/vulkaninfo --summary
- name: Build
run: cargo build --tests --workspace --features gpu --locked
- name: Run tests
# Profile "ci" is configured in .config/nextest.toml
run: cargo nextest run --workspace --features gpu --profile ci --locked
- name: Upload test report
uses: actions/upload-artifact@v4
with:
name: junit-${{ matrix.os }}.xml
path: target/nextest/ci/junit.xml
# After tests are run, this hacky script will process the JUnit output of nextest
# and will create a GH Issue if there is a test marked as flaky,
# Failure of updating an issue is ignored because it fails for external contributors.
process-gpu-results:
runs-on: ubuntu-latest
needs: rust-gpu-tests
permissions:
contents: read
issues: write
strategy:
matrix:
os: [ ubuntu-latest ]
steps:
- name: Download test report
uses: actions/download-artifact@v4
with:
name: junit-${{ matrix.os }}.xml
- name: Process test report
id: process-test-report
run: |
pip install yq
xq '.. | select(type == "object") | select(has("flakyFailure"))' junit.xml > flaky_tests.json
echo has_flaky_tests=$(jq '. | has("flakyFailure")' flaky_tests.json) >> $GITHUB_OUTPUT
- name: Get flaky test details
id: get-flaky-tests
if: ${{ steps.process-test-report.outputs.has_flaky_tests == 'true' }}
run: |
echo "Flaky tests found"
echo test=$(jq '.["@name"]' flaky_tests.json -r ) >> $GITHUB_OUTPUT
delimiter="###r###"
echo "content<<$delimiter" >> $GITHUB_OUTPUT
echo "$(jq '[.flakyFailure] | flatten | .[0]["system-err"]' flaky_tests.json -r)" >> $GITHUB_OUTPUT
echo $delimiter >> $GITHUB_OUTPUT
- name: pull issue template
if: ${{ steps.process-test-report.outputs.has_flaky_tests == 'true' }}
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/ISSUE_TEMPLATE/flaky_test.md
sparse-checkout-cone-mode: false
- name: Create issue for flaky tests
continue-on-error: true
id: create-issue
if: ${{ steps.process-test-report.outputs.has_flaky_tests == 'true' }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_NAME: ${{ steps.get-flaky-tests.outputs.test }}
SYSTEM_ERROR: ${{ steps.get-flaky-tests.outputs.content }}
REPOSITORY: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
JOB_ID: ${{ github.job }}
SHA: ${{ github.sha }}
WORKFLOW: ${{ github.workflow }}
JOB: ${{ github.job }}
BRANCH: ${{ github.ref }}
OS: ${{ matrix.os }}
with:
filename: .github/ISSUE_TEMPLATE/flaky_test.md
update_existing: true