add parsing for if and loop expressions #41
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 | |
on: | |
push: | |
branches: ["master"] | |
merge_group: | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: 0 | |
CARGO_NET_RETRY: 10 | |
RUST_BACKTRACE: short | |
RUSTFLAGS: "-D warnings" | |
RUSTUP_MAX_RETRIES: 10 | |
jobs: | |
rust: | |
runs-on: ubuntu-latest | |
env: | |
RUST_CHANNEL: nightly | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
run: | | |
rustup update --no-self-update ${{ env.RUST_CHANNEL }} | |
rustup default ${{ env.RUST_CHANNEL }} | |
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt clippy | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609 | |
with: | |
key: ${{ env.RUST_CHANNEL }} | |
- name: cargo build | |
run: cargo build --quiet | |
- name: cargo clippy | |
run: cargo clippy --quiet | |
- name: cargo test | |
run: cargo test -- --nocapture --quiet | |
- name: cargo fmt --check | |
run: cargo fmt --check | |
unused_dependencies: | |
runs-on: ubuntu-latest | |
env: | |
RUST_CHANNEL: nightly | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
run: | | |
rustup update --no-self-update ${{ env.RUST_CHANNEL }} | |
rustup default ${{ env.RUST_CHANNEL }} | |
- name: install cargo-udeps | |
uses: taiki-e/install-action@cargo-udeps | |
- name: cargo udeps | |
run: cargo udeps | |
benchmarks: | |
name: Benchmarks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
id: rust-toolchain | |
with: | |
toolchain: stable | |
- name: "Setup codspeed" | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-codspeed | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}- | |
${{ runner.os }}-cargo- | |
- name: "Build benchmarks" | |
run: cargo codspeed build | |
- name: "Run benchmarks" | |
uses: CodSpeedHQ/action@v2 | |
with: | |
run: cargo codspeed run | |
token: ${{ secrets.CODSPEED_TOKEN }} |