From 1fc5c5e6195113554140b9e1b78ed8de80214e47 Mon Sep 17 00:00:00 2001 From: pawurb Date: Fri, 25 Oct 2024 13:03:18 +0200 Subject: [PATCH] Add CLI smoke test CI --- .github/workflows/ci.yml | 14 ++++++++++++++ test.sh | 8 ++++++++ 2 files changed, 22 insertions(+) create mode 100755 test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d64d635..97bf776 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,20 @@ jobs: run: cargo fmt --all --check - name: Lint run: cargo clippy --all --all-features -- -D warnings + - name: Smoke test CLI + env: + DATABASE_URL: postgres://postgres:secret@localhost:5432/pg-extras-rs-test + run: | + cargo run --bin pgextras + exit_code=$? + if [ $exit_code -eq 2 ]; then + echo "Command completed successfully." + else + echo "Command failed." + exit 1 + fi + + cargo run --bin pgextras cache-hit - name: Run tests for PG 12 env: PG_VERSION: 12 diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..a12a4fb --- /dev/null +++ b/test.sh @@ -0,0 +1,8 @@ +cargo run --bin pgextras +exit_code=$? +if [ $exit_code -eq 2 ]; then + echo "Command completed successfully." +else + echo "Command failed." + exit 1 +fi \ No newline at end of file