Initial CI workflow #13
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: checks | |
on: | |
pull_request: | |
merge_group: | |
push: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dsherret/rust-toolchain-file@v1 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-check-${{ hashFiles('**/Cargo.lock') }} | |
- run: RUSTFLAGS="-D warnings" cargo check --all-targets | |
clippy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dsherret/rust-toolchain-file@v1 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.lock') }} | |
- run: RUSTFLAGS="-D warnings" cargo clippy --all-targets | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dsherret/rust-toolchain-file@v1 | |
- uses: extractions/setup-just@v2 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }} | |
- name: Setup | |
run: | | |
just get-mainnet-archive-db | |
just pg | |
just wait-for-pg | |
- name: Test | |
run: just test | |
- name: Tear down | |
run: just pg-down | |
rustfmt: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dsherret/rust-toolchain-file@v1 | |
- run: cargo fmt --check | |
dprint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-dprint | |
- run: npm i -g sql-formatter | |
- uses: actions/checkout@v4 | |
- uses: dprint/[email protected] | |
cspell: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: streetsidesoftware/cspell-action@v6 | |
with: | |
incremental_files_only: false |