Skip to content

ga build

ga build #5

Workflow file for this run

name: Build and Test
on: [push, pull_request]
jobs:
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:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Install ICU (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y libicu-dev
- name: Install ICU (macOS)
if: matrix.os == 'macos-latest'
run: brew install icu4c
- name: Install vcpkg (Windows)
if: matrix.os == 'windows-latest'
uses: lukka/run-vcpkg@v7
with:
vcpkgGitCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- name: Install ICU (Windows)
if: matrix.os == 'windows-latest'
run: |
vcpkg install icu:x64-windows
vcpkg integrate install
echo "C:\vcpkg\installed\x64-windows\bin" >> $env:GITHUB_PATH
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
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: |
cargo fmt --all -- --check
cargo clippy --all -- -D warnings
- name: Build Extension
run: cargo pgrx package
env:
ICU_VERSION: 74
VCPKGRS_DYNAMIC: 1
- 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 ICU
run: sudo apt-get install -y libicu-dev