Repository navigation
127 lines (114 loc) · 5.11 KB
/
Copy pathdatabase-e2e.yml
File metadata and controls
127 lines (114 loc) · 5.11 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
name: database E2E
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Deployment · test · {0} · {1}', inputs.operation_id, inputs.step_id) || format('Test · database_e2e · {0}', github.event_name) }}
on:
pull_request:
paths:
- 'database/**'
- '.github/workflows/database-e2e.yml'
workflow_dispatch:
inputs:
source_sha:
description: Full source commit SHA
required: true
type: string
operation_id:
required: true
type: string
step_id:
required: true
type: string
concurrency:
group: database-e2e-${{ inputs.operation_id || inputs.source_sha || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
# Keep integration on the engine release that provides configuration::ensure.
III_RELEASE_TAG: 'iii/v0.24.0-rc.2'
jobs:
e2e:
name: Harness (sqlite + postgres + mysql)
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
ref: ${{ inputs.source_sha || github.sha }}
- name: Validate Release Control dispatch
if: github.event_name == 'workflow_dispatch'
env:
RELEASE_CONTROL_BOT_LOGIN: ${{ vars.RELEASE_CONTROL_BOT_LOGIN }}
run: >-
python3 .github/scripts/deployment_control_contract.py validate-dispatch
--operation-id '${{ inputs.operation_id }}'
--step-id '${{ inputs.step_id }}'
- name: Rewrite SSH to HTTPS for public deps
run: git config --local url."https://github.com/".insteadOf "ssh://git@github.com/"
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # v1
with:
toolchain: 1.97.1
- name: Cache cargo registry & build
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
workspaces: database
# database/build.rs shells out to pnpm to build the injected console
# UI (ui/dist) before embedding it via include_str! — mirrors the
# ci.yml rust job. Version comes from the repo-root package.json
# `packageManager` field (the UI pnpm workspace root).
- name: Setup pnpm (for build.rs UI build)
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
- name: Install Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
# 22, not 20: pnpm@11 requires the node:sqlite builtin (Node ≥22.5)
# for its store, and ci.yml's pnpm jobs already standardize on 22.
node-version: '22'
cache: 'npm'
cache-dependency-path: database/tests/e2e/workers/harness/package-lock.json
# The harness brings up its own postgres + mysql via docker-compose
# (not GHA `services:`) so local and CI runs share one stack definition.
- name: Install iii engine (next)
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
curl -fsSL --retry 3 --retry-connrefused --retry-delay 5 \
https://install.iii.dev/iii/main/install.sh | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Verify engine
run: iii --version
- name: Run harness
working-directory: database/tests/e2e
# --with-cargo-test runs `cargo test --all-features` against the
# already-running postgres + mysql so the gated driver/pool tests
# actually exercise their target DBs (otherwise they early-return).
run: ./run-tests.sh --with-cargo-test
- name: Upload report on failure
if: failure()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: database-e2e-report
path: |
database/tests/e2e/reports/
retention-days: 7
evidence:
needs: e2e
if: github.event_name == 'workflow_dispatch' && always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
ref: "${{ github.sha }}"
- run: |
subject=$(jq -cn --arg source_sha '${{ inputs.source_sha }}' '{source_sha:$source_sha}')
checks=$(jq -cn --arg status '${{ needs.e2e.result }}' '[{name:"database_e2e",status:$status}]')
python3 .github/scripts/deployment_control_contract.py write-test-result --kind test --repository '${{ github.repository }}' \
--operation-id '${{ inputs.operation_id }}' --step-id '${{ inputs.step_id }}' --run-id '${{ github.run_id }}' \
--run-attempt '${{ github.run_attempt }}' --workflow database-e2e.yml --event '${{ github.event_name }}' --sha '${{ github.sha }}' \
--subject "$subject" --checks "$checks" --effects '[]' --outputs '{}' --output e2e-result.json
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: e2e-result-${{ inputs.operation_id }}-${{ inputs.step_id }}
path: e2e-result.json
retention-days: 30