From 0ff3783ff8cd8f42fa1481937ce34ae33002d85a Mon Sep 17 00:00:00 2001 From: Norbert Melzer Date: Sun, 7 Jun 2026 17:53:02 +0200 Subject: [PATCH] add CI --- .tangled/workflows/tests.yaml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .tangled/workflows/tests.yaml diff --git a/.tangled/workflows/tests.yaml b/.tangled/workflows/tests.yaml new file mode 100644 index 0000000..19e949f --- /dev/null +++ b/.tangled/workflows/tests.yaml @@ -0,0 +1,39 @@ +when: + - event: ["pull_request"] + branch: ["main"] + +engine: "nixery" + +clone: + skip: false + depth: 1 + submodules: false + +dependencies: + nixpkgs: + - cargo + - diesel-cli + - postgresql + - rustc + +steps: + - name: "Start PostgreSQL" + command: | + initdb -D /tmp/pgdata + pg_ctl -D /tmp/pgdata -o "-k /tmp -p 5432" -w start + createdb -h 127.0.0.1 -p 5432 -U postgres app_test + + - name: "prepare DB" + command: | + cd rust + diesel setup + diesel migration run + environment: + DATABASE_URL: postgres://postgres:postgres@localhost:5432/henka + TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/henka_test + + - name: "run tests" + command: | + cargo test + environment: + TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/henka_test -- 2.51.2