ci: use less docker #1
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
name: Check | |
on: | |
pull_request: | |
paths: | |
- ".cargo" | |
- ".github/workflows/check.yml" | |
- "crates/**" | |
- "src/**" | |
- "build.rs" | |
- "Cargo.lock" | |
- "Cargo.toml" | |
- "rust-toolchain.toml" | |
- "rustfmt.toml" | |
- "taplo.toml" | |
- "vchord.control" | |
push: | |
paths: | |
- ".cargo" | |
- ".github/workflows/lint.yml" | |
- "crates/**" | |
- "src/**" | |
- "build.rs" | |
- "Cargo.lock" | |
- "Cargo.toml" | |
- "rust-toolchain.toml" | |
- "rustfmt.toml" | |
- "taplo.toml" | |
- "vchord.control" | |
merge_group: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
SCCACHE_GHA_ENABLED: true | |
RUSTC_WRAPPER: sccache | |
RUSTFLAGS: "-Dwarnings" | |
jobs: | |
style: | |
runs-on: "ubuntu-24.04" | |
steps: | |
- name: Set up Environment | |
run: | | |
curl -fsSL https://github.com/tamasfe/taplo/releases/latest/download/taplo-full-linux-$(uname -m).gz | gzip -d - | install -m 755 /dev/stdin /usr/local/bin/taplo | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Typos | |
uses: crate-ci/typos@master | |
- name: Taplo | |
run: taplo fmt --check | |
- name: Ruff | |
uses: astral-sh/ruff-action@v1 | |
- name: Rustfmt | |
run: cargo fmt --check | |
lint: | |
strategy: | |
matrix: | |
runner: ["ubuntu-24.04", "ubuntu-24.04-arm"] | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- name: Set up Sccache | |
uses: mozilla-actions/sccache-action@v0.0.7 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Clippy | |
run: cargo clippy --workspace --exclude vchord | |
- name: Cargo Test | |
run: cargo test --workspace --exclude vchord --no-fail-fast | |
psql: | |
strategy: | |
matrix: | |
version: ["13", "14", "15", "16", "17"] | |
runner: ["ubuntu-24.04", "ubuntu-24.04-arm"] | |
exclude: | |
- version: "13" | |
runner: "ubuntu-24.04" | |
- version: "13" | |
runner: "ubuntu-24.04-arm" | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- name: Set up Environment | |
run: | | |
sudo apt-get remove -y '^postgres.*' '^libpq.*' | |
sudo apt-get purge -y '^postgres.*' '^libpq.*' | |
sudo update-alternatives --install /usr/bin/clang clang $(which clang-18) 255 | |
sudo apt-get install -y postgresql-common | |
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y | |
sudo apt-get install -y postgresql-server-dev-${{ matrix.version }} | |
sudo apt-get install -y postgresql-${{ matrix.version }} postgresql-${{ matrix.version }}-pgvector | |
echo "local all all trust" | sudo tee /etc/postgresql/${{ matrix.version }}/main/pg_hba.conf | |
echo "host all all 127.0.0.1/32 trust" | sudo tee -a /etc/postgresql/${{ matrix.version }}/main/pg_hba.conf | |
echo "host all all ::1/128 trust" | sudo tee -a /etc/postgresql/${{ matrix.version }}/main/pg_hba.conf | |
sudo -iu postgres createuser -s -r $USER | |
sudo -iu postgres createdb -O $USER $USER | |
sudo -iu postgres psql -c 'ALTER SYSTEM SET shared_preload_libraries = "vchord.so"' | |
sudo systemctl stop postgresql | |
curl -fsSL https://github.com/tensorchord/pgrx/releases/download/v0.12.9/cargo-pgrx-v0.12.9-$(uname -m)-unknown-linux-musl.tar.gz | tar -xOzf - ./cargo-pgrx | install -m 755 /dev/stdin /usr/local/bin/cargo-pgrx | |
cargo pgrx init --pg${{ matrix.version }}=$(which pg_config) | |
curl -fsSL https://github.com/risinglightdb/sqllogictest-rs/releases/download/v0.26.4/sqllogictest-bin-v0.26.4-$(uname -m)-unknown-linux-musl.tar.gz | tar -xOzf - ./sqllogictest | install -m 755 /dev/stdin /usr/local/bin/sqllogictest | |
- name: Set up Sccache | |
uses: mozilla-actions/sccache-action@v0.0.7 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Clippy | |
run: cargo clippy -p vchord --features pg${{ matrix.version }} -- --no-deps | |
- name: Install | |
run: cargo pgrx install -p vchord --features pg${{ matrix.version }} --release --sudo | |
- name: Sqllogictest | |
run: | | |
sudo systemctl start postgresql | |
psql -c 'CREATE EXTENSION IF NOT EXISTS vchord CASCADE;' | |
sqllogictest --db $USER --user $USER './tests/**/*.slt' |