Skip to content

Deploy wxyc_identity_match_* plpgsql functions (wiki §3.3.5) #37

Deploy wxyc_identity_match_* plpgsql functions (wiki §3.3.5)

Deploy wxyc_identity_match_* plpgsql functions (wiki §3.3.5) #37

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- run: cargo fmt --check
- run: cargo clippy --all-targets -- -D warnings
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build tests
run: cargo build --tests
- name: Run unit + CLI + oracle tests (no DB)
run: cargo test --lib --bins --test cli_tests --test oracle_tests --test error_handling
test-postgres:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: wikidata
POSTGRES_PASSWORD: wikidata
POSTGRES_DB: wikidata_test
ports:
- 5435:5432
options: >-
--health-cmd "pg_isready -U wikidata"
--health-interval 5s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install wxyc_unaccent rules into the PG service container
# Required by migrations/0003_wxyc_identity_match_functions.sql.
# Alpine layout: /usr/local/share/postgresql/tsearch_data.
run: |
PG_CID=$(docker ps -q --filter ancestor=postgres:16-alpine)
if [ -z "$PG_CID" ]; then
echo "no postgres:16-alpine service container running" >&2
exit 1
fi
docker cp vendor/wxyc-etl/wxyc_unaccent.rules \
"$PG_CID:/usr/local/share/postgresql/tsearch_data/wxyc_unaccent.rules"
docker cp vendor/wxyc-etl/wxyc_unaccent.version \
"$PG_CID:/usr/local/share/postgresql/tsearch_data/wxyc_unaccent.version"
- name: Run PostgreSQL integration tests
env:
TEST_DATABASE_URL: postgresql://wikidata:wikidata@localhost:5435/wikidata_test
run: cargo test --test import_test --test pg_import_test -- --test-threads=1
- name: Run charset-torture round-trip
env:
TEST_DATABASE_URL: postgresql://wikidata:wikidata@localhost:5435/wikidata_test
run: cargo test --test charset_torture -- --test-threads=1 --include-ignored
- name: Run wxyc_identity_match_* parity test
env:
TEST_DATABASE_URL: postgresql://wikidata:wikidata@localhost:5435/wikidata_test
run: cargo test --test wxyc_identity_match_parity_test -- --ignored --test-threads=1