- Notifications
You must be signed in to change notification settings - Fork514
Merge pull request #1262 from CobaltCause/push-sswwslomtkmm#743
This file contains hidden or 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:CI | |
on: | |
pull_request: | |
branches: | |
-master | |
push: | |
branches: | |
-master | |
env: | |
RUSTFLAGS:-Dwarnings | |
RUST_BACKTRACE:1 | |
jobs: | |
rustfmt: | |
name:rustfmt | |
runs-on:ubuntu-latest | |
steps: | |
-uses:actions/checkout@v5 | |
-uses:dtolnay/rust-toolchain@stable | |
with: | |
components:rustfmt | |
-run:cargo fmt --all -- --check | |
clippy: | |
name:clippy | |
runs-on:ubuntu-latest | |
steps: | |
-uses:actions/checkout@v5 | |
-uses:dtolnay/rust-toolchain@stable | |
with: | |
components:clippy | |
-run:echo "version=$(rustc --version)" >> $GITHUB_OUTPUT | |
id:rust-version | |
-uses:actions/cache@v4 | |
with: | |
path:~/.cargo/registry/index | |
key:index-${{ runner.os }}-${{ github.run_number }} | |
restore-keys:| | |
index-${{ runner.os }}- | |
-run:cargo generate-lockfile | |
-uses:actions/cache@v4 | |
with: | |
path:~/.cargo/registry/cache | |
key:registry-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} | |
-run:cargo fetch | |
-uses:actions/cache@v4 | |
with: | |
path:target | |
key:clippy-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} | |
-run:cargo clippy --all --all-targets | |
check-wasm32: | |
name:check-wasm32 | |
runs-on:ubuntu-latest | |
steps: | |
-uses:actions/checkout@v5 | |
-uses:dtolnay/rust-toolchain@stable | |
with: | |
targets:wasm32-unknown-unknown | |
-run:echo "version=$(rustc --version)" >> $GITHUB_OUTPUT | |
id:rust-version | |
-uses:actions/cache@v4 | |
with: | |
path:~/.cargo/registry/index | |
key:index-${{ runner.os }}-${{ github.run_number }} | |
restore-keys:| | |
index-${{ runner.os }}- | |
-run:cargo generate-lockfile | |
-uses:actions/cache@v4 | |
with: | |
path:~/.cargo/registry/cache | |
key:registry-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} | |
-run:cargo fetch | |
-uses:actions/cache@v4 | |
with: | |
path:target | |
key:check-wasm32-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} | |
-run:cargo check --target wasm32-unknown-unknown --manifest-path tokio-postgres/Cargo.toml --no-default-features --features js | |
env: | |
RUSTFLAGS:--cfg getrandom_backend="wasm_js" | |
test: | |
name:test | |
runs-on:ubuntu-latest | |
steps: | |
-uses:actions/checkout@v5 | |
-run:docker compose up -d | |
-uses:dtolnay/rust-toolchain@1.81.0 | |
-run:echo "version=$(rustc --version)" >> $GITHUB_OUTPUT | |
id:rust-version | |
-uses:actions/cache@v4 | |
with: | |
path:~/.cargo/registry/index | |
key:index-${{ runner.os }}-${{ github.run_number }} | |
restore-keys:| | |
index-${{ runner.os }}- | |
-run:cargo generate-lockfile | |
-uses:actions/cache@v4 | |
with: | |
path:~/.cargo/registry/cache | |
key:registry-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} | |
-run:cargo fetch | |
-uses:actions/cache@v4 | |
with: | |
path:target | |
key:test-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} | |
-run:cargo test --all | |
-run:cargo test --manifest-path tokio-postgres/Cargo.toml --no-default-features | |
-run:cargo test --manifest-path tokio-postgres/Cargo.toml --all-features |