Try to fix Actions again 3 #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust Continuous Integration | |
env: | |
RUSTFLAGS: -Dwarnings | |
CARGO_TERM_COLOR: always | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PG_VER: 17 | |
on: | |
pull_request_target: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
branches: | |
- master | |
paths-ignore: | |
- "**/*.md" | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- "**/*.md" | |
jobs: | |
rust-checks: | |
name: Rust Checks | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# TODO: other OS | |
os: [ubuntu-latest] | |
action: | |
- command: build | |
args: --release | |
- command: fmt | |
args: --all -- --check | |
- command: clippy | |
args: --all-features --workspace | |
- command: pgrx test | |
args: --all-features | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install PostgreSQL | |
run: | | |
sudo apt install -y wget gnupg | |
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
wget --quiet -O- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo apt update -y -qq | |
sudo apt install -y postgresql-server-dev-$PG_VER | |
- name: Install cargo pgrx | |
run: cargo install --path cargo-pgrx | |
- name: cargo pgrx init | |
run: cargo pgrx init "--pg$PG_VER=$(which pg_config)" | |
- name: Run Command | |
run: cargo ${{ matrix.action.command }} ${{ matrix.action.args }} --runas postgres --pgdata=/tmp/pgdata |