name: CI
on:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
rust:
name: Rust checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo and target
uses: Swatinem/rust-cache@v2
- name: cargo check
run: cargo check --all-targets --all-features
- name: cargo test
run: cargo test --all-targets --all-features
- name: cargo fmt --check
run: cargo fmt --all --check
- name: cargo clippy
run: cargo clippy --all-targets --all-features -- -D warnings
packaging:
name: Packaging checks (${{ matrix.runner }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-latest
- macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo and target
uses: Swatinem/rust-cache@v2
- name: cargo install smoke test
run: |
cargo install --path . --locked --root "$RUNNER_TEMP/gshell-install"
"$RUNNER_TEMP/gshell-install/bin/gshell" --version
- name: release build smoke test
run: cargo build --release --locked
- name: Homebrew formula render validation
shell: bash
run: |
set -euo pipefail
scripts/render-homebrew-formula.sh \
0.1.0 \
0000000000000000000000000000000000000000000000000000000000000000 \
1111111111111111111111111111111111111111111111111111111111111111 \
2222222222222222222222222222222222222222222222222222222222222222 \
> "$RUNNER_TEMP/gshell.rb"
ruby -c "$RUNNER_TEMP/gshell.rb"