feat: Enable Disk Caching for Multiple Sources (Supersedes PR#30) #262
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" | |
- "**/*.toml" | |
- ".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: [17] | |
steps: | |
- name: Checkout Git Repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
# Caches from base branches are available to PRs, but not across unrelated branches, so we only | |
# save the cache on the 'dev' branch, but load it on all branches. | |
- name: Install Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: "v1" | |
shared-key: ${{ runner.os }}-rust-cache-pg_analytics-${{ HashFiles('Cargo.lock') }} | |
cache-targets: true | |
cache-on-failure: true | |
cache-all-crates: true | |
save-if: ${{ github.ref == 'refs/heads/dev' }} | |
- 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: Extract pgrx version | |
run: echo "PGRX_VERSION=$(cargo tree --depth 1 -i pgrx -p pg_analytics | head -n 1 | cut -f2 -dv)" >> $GITHUB_ENV | |
- name: Install pgrx | |
run: cargo install --locked cargo-pgrx --version ${{ env.PGRX_VERSION }} | |
- 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 | |
- name: Dependency Check | |
run: cargo install cargo-machete && cargo machete | |
- name: Install taplo | |
run: cargo +stable install taplo-cli --version ^0.9 --locked | |
# If you encounter an error, try running 'taplo format' to fix the formatting automatically. | |
- name: Check Cargo.toml Formatting | |
run: taplo format --check |