Repository navigation
104 lines (96 loc) · 3.84 KB
/
Copy pathtest-src.yml
File metadata and controls
104 lines (96 loc) · 3.84 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
name: Test source
on:
workflow_call:
inputs:
bundle-key:
description: "Key needed to access bundle of artifacts"
required: true
type: string
build-target:
description: "Target name as defined by inputs.sh"
required: true
type: string
container-path:
description: "Path to built container at registry"
required: true
type: string
runs-on:
description: "Runner label to use (e.g., ubuntu-24.04 or ubuntu-24.04-arm)"
required: true
type: string
cancel-stale:
description: "Share a develop-wide group so a newer run's tests cancel these; only for runs verified current"
required: false
type: boolean
default: false
env:
INTEGRATION_TESTS_ARGS: "--extended --exclude feature_pruning,feature_dbcrash"
CI_FAILFAST_TEST_LEAVE_DANGLING: 1 # GHA does not care about dangling processes and setting this variable avoids killing the CI script itself on error
jobs:
test-src:
name: Test source
runs-on: ${{ inputs.runs-on }}
# A newer develop run's tests cancel these; see the concurrency comment in build.yml.
concurrency:
group: ${{ github.workflow }}-${{ inputs.cancel-stale && github.ref || github.run_id }}-test-src-${{ inputs.build-target }}
cancel-in-progress: true
container:
image: ${{ inputs.container-path }} # zizmor: ignore[unpinned-images] built earlier in this run by build-container.yml
# SYS_PTRACE is required by LeakSanitizer's stop-the-world
# (https://github.com/google/sanitizers/issues/764)
# LINUX_IMMUTABLE lets feature_reindex_readonly.py run chattr +i
options: --user root --cap-add LINUX_IMMUTABLE --cap-add SYS_PTRACE
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
allow-unsafe-pr-checkout: true
persist-credentials: false
fetch-depth: 1
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: ${{ inputs.bundle-key }}
- name: Manage releases cache
uses: actions/cache@v5
if: inputs.build-target == 'linux64'
with:
path: |
releases
key: releases-${{ hashFiles('ci/test/00_setup_env_native_previous_releases.sh', 'test/get_previous_releases.py') }}
- name: Run functional tests
id: test
env:
BUILD_TARGET: ${{ inputs.build-target }}
BUNDLE_KEY: ${{ inputs.bundle-key }}
run: |
git config --global --add safe.directory "$PWD"
./ci/dash/bundle-artifacts.sh extract
./ci/dash/slim-workspace.sh
source ./ci/dash/matrix.sh
./ci/dash/test_integrationtests.sh ${INTEGRATION_TESTS_ARGS}
shell: bash
- name: Bundle test logs
id: bundle
if: success() || (failure() && steps.test.outcome == 'failure')
env:
BUILD_TARGET: ${{ inputs.build-target }}
run: |
echo "short-sha=$(git rev-parse --short=8 HEAD)" >> "${GITHUB_OUTPUT}"
( [ -d "testlogs" ] && echo "upload-logs=true" >> "${GITHUB_OUTPUT}" && ./ci/dash/bundle-logs.sh ) \
|| echo "upload-logs=false" >> "${GITHUB_OUTPUT}"
shell: bash
- name: Upload test logs
uses: actions/upload-artifact@v6
if: |
success() || (failure() && steps.test.outcome == 'failure')
&& steps.bundle.outputs.upload-logs == 'true'
with:
name: test_logs-${{ inputs.build-target }}-${{ steps.bundle.outputs.short-sha }}
path: |
test_logs-${{ inputs.build-target }}.tar.zst
test_logs-${{ inputs.build-target }}.tar.zst.sha256
compression-level: 0
overwrite: true
retention-days: 1