diff --git a/.github/workflows/tests.yml b/.github/workflows/build.yml similarity index 56% rename from .github/workflows/tests.yml rename to .github/workflows/build.yml index fa7a370..35ceedf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,16 @@ -name: tests +name: Build and Test on: [push, pull_request] + jobs: - check: - runs-on: ubuntu-latest + build: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - name: Check out uses: actions/checkout@v3 + - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -13,6 +18,7 @@ jobs: toolchain: stable override: true components: rustfmt, clippy + - name: Set up cargo cache uses: actions/cache@v3 continue-on-error: false @@ -25,20 +31,49 @@ jobs: target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo- + - name: Install pgrx run: | cargo install --locked cargo-pgrx || true cargo pgrx init + - name: Lint run: | - rustfmt **/*.rs + cargo fmt --all -- --check cargo clippy --all -- -D warnings + + - name: Build Extension + run: cargo pgrx package + + - name: Upload Extension Artifact + uses: actions/upload-artifact@v3 + with: + name: pg_sqids-${{ runner.os }} + path: | + target/release/libpg_sqids.so + target/release/libpg_sqids.dylib + target/release/pg_sqids.dll + + - name: Test + run: cargo test --all + + check: + runs-on: ubuntu-latest + steps: + - name: Check out + uses: actions/checkout@v3 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Install cargo check tools - run: | - cargo install --locked cargo-outdated || true + run: cargo install --locked cargo-outdated || true + - name: Check run: | cargo outdated --exit-code 1 rm -rf ~/.cargo/advisory-db - - name: Test - run: cargo test --all \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 2e3e064..a677cab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,8 @@ pg_test = [] [dependencies] pgrx = "=0.11.4" -sqids = "0.4.1" -thiserror = "1.0.62" +sqids = "0.4.2" +thiserror = "2.0.8" [dev-dependencies] pgrx-tests = "=0.11.4" diff --git a/README.md b/README.md index 6871a66..1ce4557 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [Sqids PostgreSQL](https://sqids.org/postgresql) -[![Github Actions](https://img.shields.io/github/actions/workflow/status/sqids/sqids-postgresql/tests.yml)](https://github.com/sqids/sqids-postgresql/actions) +[![Github Actions](https://img.shields.io/github/actions/workflow/status/sqids/sqids-postgresql/build.yml)](https://github.com/sqids/sqids-postgresql/actions) [Sqids](https://sqids.org/postgresql) (*pronounced "squids"*) is a small library that lets you **generate unique IDs from numbers**. It's good for link shortening, fast & URL-safe ID generation and decoding back into numbers for quicker database lookups.