update sqllogicaltest #12
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 | |
concurrency: | |
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | |
cancel-in-progress: true | |
on: | |
push: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- ".github/ISSUE_TEMPLATE/**" | |
- ".github/pull_request_template.md" | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- ".github/ISSUE_TEMPLATE/**" | |
- ".github/pull_request_template.md" | |
# manual trigger | |
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow | |
workflow_dispatch: | |
jobs: | |
# Check crate compiles | |
linux-build-lib: | |
name: cargo check | |
runs-on: ubuntu-latest | |
container: | |
image: amd64/rust | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
# these represent dependencies downloaded by cargo | |
# and thus do not depend on the OS, arch nor rust version. | |
path: /github/home/.cargo | |
key: cargo-cache- | |
- name: Setup Rust toolchain | |
uses: ./.github/actions/setup-builder | |
with: | |
rust-version: stable | |
- name: Check workspace in debug mode | |
run: cargo check | |
# test the crate | |
linux-test: | |
name: cargo test (amd64) | |
needs: [ linux-build-lib ] | |
runs-on: ubuntu-latest | |
container: | |
image: amd64/rust | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: /github/home/.cargo | |
# this key equals the ones on `linux-build-lib` for re-use | |
key: cargo-cache- | |
- name: Setup Rust toolchain | |
uses: ./.github/actions/setup-builder | |
with: | |
rust-version: stable | |
- name: Run tests (excluding doctests) | |
run: cargo test --lib --tests --bins | |
- name: Verify Working Directory Clean | |
run: git diff --exit-code | |
check-fmt: | |
name: Check cargo fmt | |
runs-on: ubuntu-latest | |
container: | |
image: amd64/rust | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Rust toolchain | |
uses: ./.github/actions/setup-builder | |
with: | |
rust-version: stable | |
- name: Run | |
run: ci/scripts/rust_fmt.sh | |
cargo-toml-formatting-checks: | |
name: check Cargo.toml formatting | |
needs: [ linux-build-lib ] | |
runs-on: ubuntu-latest | |
container: | |
image: amd64/rust | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: /github/home/.cargo | |
# this key equals the ones on `linux-build-lib` for re-use | |
key: cargo-cache- | |
- name: Setup Rust toolchain | |
uses: ./.github/actions/setup-builder | |
with: | |
rust-version: stable | |
- name: Install cargo-tomlfmt | |
run: which cargo-tomlfmt || cargo install cargo-tomlfmt | |
- name: Check Cargo.toml formatting | |
run: | | |
# if you encounter error, try rerun the command below, finally run 'git diff' to | |
# check which Cargo.toml introduces formatting violation | |
# | |
# ignore ./Cargo.toml because putting workspaces in multi-line lists make it easy to read | |
ci/scripts/rust_toml_fmt.sh | |
git diff --exit-code | |
clippy: | |
name: clippy | |
needs: [ linux-build-lib ] | |
runs-on: ubuntu-latest | |
container: | |
image: amd64/rust | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: /github/home/.cargo | |
# this key equals the ones on `linux-build-lib` for re-use | |
key: cargo-cache- | |
- name: Setup Rust toolchain | |
uses: ./.github/actions/setup-builder | |
with: | |
rust-version: stable | |
- name: Install Clippy | |
run: rustup component add clippy | |
- name: Run clippy | |
run: ci/scripts/rust_clippy.sh |