chore: fix hook linting message grammar (#580) #380
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
# This workflow run when something is pushed on main and it does: | |
# - normal checks like in the normal PRs | |
# - expand the test suite to be run on multiple OS | |
# - runs the coverage and prints in the command line | |
name: CI on main | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
env: | |
RUST_LOG: info | |
RUST_BACKTRACE: 1 | |
jobs: | |
format: | |
name: Format Rust Files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Support longpaths | |
run: git config core.longpaths true | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
components: rustfmt | |
bins: taplo-cli | |
- name: Run rustfmt | |
run: | | |
cargo fmt --all --verbose -- --check | |
taplo format --check | |
lint: | |
name: Lint Rust Files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
components: clippy | |
- name: Run cargo check | |
run: cargo check --workspace --all-targets --release | |
- name: Run clippy | |
run: cargo lint | |
check-dependencies: | |
name: Check Dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
channel: nightly | |
- name: Install udeps | |
run: cargo install cargo-udeps --locked | |
- name: Run udeps | |
run: cargo +nightly udeps | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
- os: ubuntu-latest | |
- os: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
bins: cargo-nextest | |
- name: Run tests on ${{ matrix.os }} | |
run: cargo nextest run --workspace --verbose | |
- name: Clean cache | |
run: cargo cache --autoclean | |
coverage: | |
name: Test262 Coverage | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
steps: | |
# ref: https://github.com/orgs/community/discussions/26952 | |
- name: Support longpaths | |
if: matrix.os == 'windows-latest' | |
run: git config --system core.longpaths true | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@v1 | |
- name: Compile | |
run: cargo build --release --locked -p xtask_coverage | |
- name: Run Test262 suite | |
continue-on-error: true | |
run: cargo coverage | |
- name: Clean cache | |
run: cargo cache --autoclean |