Repository navigation
84 lines (74 loc) · 2.48 KB
/
Copy pathequivalence.yml
File metadata and controls
84 lines (74 loc) · 2.48 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
# Diff the derived concepts built in PostgreSQL vs DuckDB.
name: equivalence
on:
workflow_call:
inputs:
schema:
description: "Derived schema to compare."
type: string
default: "mimiciv_derived"
pg-artifact:
description: "Artifact holding the PostgreSQL schema dump."
type: string
default: "psql-derived"
pg-dump-file:
description: "File name of the schema dump inside the artifact."
type: string
default: "derived.sql"
duckdb-artifact:
description: "Artifact holding the DuckDB database."
type: string
default: "duckdb-db"
db-file:
description: "File name of the DuckDB database inside the artifact."
type: string
default: "mimic4.db"
jobs:
diff:
runs-on: ubuntu-latest
container: python:3.12
services:
postgres:
image: postgres:17
env:
POSTGRES_PASSWORD: postgres
# Force byte-order (C) collation so string ordering matches DuckDB's
# binary sort.
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=C --lc-ctype=C"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
PGHOST: postgres
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres
steps:
- uses: actions/checkout@v7
- name: Install tooling
run: |
apt-get update
apt-get install --yes --no-install-recommends postgresql-client
# Install pinned dependencies from the lock file, then the local
# package itself without re-resolving its dependencies.
pip install -r requirements-lock.txt
pip install --no-deps .
- name: Download PostgreSQL derived schema
uses: actions/download-artifact@v8
with:
name: ${{ inputs.pg-artifact }}
- name: Download DuckDB database
# No path: defaults to the working directory ($GITHUB_WORKSPACE inside
# the container), placing the database file at $GITHUB_WORKSPACE.
uses: actions/download-artifact@v8
with:
name: ${{ inputs.duckdb-artifact }}
- name: Restore PostgreSQL derived schema
run: |
psql -v ON_ERROR_STOP=1 -f "${{ inputs.pg-dump-file }}"
- uses: ./.github/actions/compare-concepts
with:
schema: ${{ inputs.schema }}
db_file: ${{ inputs.db-file }}