feat: Implement caching #26
Workflow file for this run
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
# workflows/lint-rust.yml | |
# | |
# Lint Rust | |
# Lint Rust files using Clippy and Rustfmt. | |
name: Lint Rust | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
paths: | |
- "**/*.rs" | |
- ".github/workflows/lint-rust.yml" | |
workflow_dispatch: | |
concurrency: | |
group: lint-rust-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint-rust: | |
name: Lint Rust Files | |
runs-on: depot-ubuntu-latest-2 | |
if: github.event.pull_request.draft == false | |
strategy: | |
matrix: | |
pg_version: [16] | |
steps: | |
- name: Checkout Git Repository | |
uses: actions/checkout@v4 | |
- name: Install & Configure Supported PostgreSQL Version | |
run: | | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
sudo apt-get update && sudo apt-get install -y postgresql-${{ matrix.pg_version }} postgresql-server-dev-${{ matrix.pg_version }} | |
- name: Install pgrx | |
run: cargo install --locked cargo-pgrx --version 0.11.3 | |
- name: Initialize pgrx for Current PostgreSQL Version | |
run: cargo pgrx init --pg${{ matrix.pg_version }}=/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config | |
- name: Run Rustfmt | |
run: cargo fmt -- --check | |
- name: Run Clippy | |
run: cargo clippy --workspace --all-targets -- -D warnings --no-deps |