-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (108 loc) · 4.34 KB
/
bindgen-roundtrip.yml
File metadata and controls
117 lines (108 loc) · 4.34 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
# Round-trip integration test for plsql-bindgen against Oracle XE 23ai.
#
# Wire path:
# 1. Pull container-registry.oracle.com/database/free:23.7.0.0-lite
# 2. Deploy a synthetic test package from corpus/synthetic/l1/
# 3. Generate bindings via `cargo run -p plsql-bindgen --
# --package <NAME>`
# 4. Run the round-trip integration test that calls the generated
# wrapper through rust-oracle, verifies the result, and prints a
# structured report.
#
# `PLSQL-BG-014` / oracle-9rkm. Plan reference: §13 (Bindings
# Generator) + §6.2.8 (Synthetic Lab).
#
# This workflow is intentionally **manual** (workflow_dispatch +
# scheduled weekly) because:
# - It requires `docker login container-registry.oracle.com` with
# a FUTC-accepted account, which can't run from anonymous PRs.
# - The pull is large (~3 GB) and takes ~5 min to boot.
# - Round-trip flakiness would block unrelated PRs if it gated
# every push.
name: bindgen-roundtrip (XE container)
on:
workflow_dispatch:
schedule:
# Weekly Saturday at 03:17 UTC — off-hours, low contention.
- cron: "17 3 * * 6"
jobs:
roundtrip:
name: bindgen round-trip (Oracle XE 23ai)
runs-on: ubuntu-latest
services:
oracle-xe:
image: container-registry.oracle.com/database/free:23.7.0.0-lite
ports:
- 1521:1521
env:
ORACLE_PWD: ${{ secrets.ORACLE_XE_PWD }}
ORACLE_CHARACTERSET: AL32UTF8
ENABLE_ARCHIVELOG: "false"
# The health-cmd runs INSIDE the service container, which already has
# ORACLE_PWD set from the secret via the `env:` block above. The
# `${{ secrets.* }}` context is NOT permitted inside `services.*.options`
# and made GitHub reject the whole workflow file (a 0s "workflow file
# issue" failure on every push); use the in-container shell var instead.
options: >-
--health-cmd "echo 'select 1 from dual;' | sqlplus -s system/$ORACLE_PWD@//localhost:1521/FREEPDB1 | grep -q 1"
--health-interval 30s
--health-timeout 10s
--health-retries 20
--health-start-period 5m
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install Oracle Instant Client
run: |
sudo apt-get update -y
sudo apt-get install -y libaio1t64 || sudo apt-get install -y libaio1
curl -L -o /tmp/instantclient.zip \
https://download.oracle.com/otn_software/linux/instantclient/2370000/instantclient-basic-linux.x64-23.7.0.25.01.zip
sudo unzip -q /tmp/instantclient.zip -d /opt/oracle
sudo ln -sf /opt/oracle/instantclient_23_7 /opt/oracle/instantclient
echo "LD_LIBRARY_PATH=/opt/oracle/instantclient" >> $GITHUB_ENV
- name: Deploy synthetic test package
env:
ORACLE_PWD: ${{ secrets.ORACLE_XE_PWD }}
run: |
/opt/oracle/instantclient/sqlplus -s \
system/$ORACLE_PWD@//localhost:1521/FREEPDB1 <<'SQL'
@corpus/synthetic/l1/pkg_employee_mgmt.pks
@corpus/synthetic/l1/pkg_employee_mgmt.pkb
exit;
SQL
- name: Generate bindings
run: |
cargo run -p plsql-bindgen -- \
--package SYSTEM.PKG_EMPLOYEE_MGMT \
--output target/generated-bindings \
--target rust
- name: Run round-trip integration test
env:
ORACLE_PWD: ${{ secrets.ORACLE_XE_PWD }}
run: |
cargo test -p plsql-bindgen --test xe_roundtrip \
--features live-roundtrip -- --nocapture
continue-on-error: false
- name: Upload generated bindings artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: generated-bindings
path: target/generated-bindings/
if-no-files-found: warn
- name: Upload coverage doctor report
if: always()
run: |
cargo run -p plsql-bindgen -- \
--package SYSTEM.PKG_EMPLOYEE_MGMT \
--output target/generated-bindings \
--target rust \
--robot-json > target/bindings-coverage.json || true
- uses: actions/upload-artifact@v4
if: always()
with:
name: bindings-coverage
path: target/bindings-coverage.json
if-no-files-found: warn