ci: fix basic checks

This commit is contained in:
Nugine
2025-02-22 15:00:39 +08:00
parent 704c41b116
commit bd1ceae375
3 changed files with 192 additions and 263 deletions

View File

@@ -1,9 +1,15 @@
name: Rust
name: CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches: [ "main" ]
branches:
- main
schedule:
- cron: '0 0 * * 0' # at midnight of each sunday
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
@@ -24,19 +30,12 @@ jobs:
cancel_others: true
paths_ignore: '["*.md"]'
build:
# See this url if required matrix jobs are hanging
# https://github.com/fkirc/skip-duplicate-actions#how-to-use-skip-check-with-required-matrix-jobs
develop:
needs: skip-check
if: needs.skip-check.outputs.should_skip != 'true'
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- nightly
steps:
- uses: arduino/setup-protoc@v3
with:
@@ -48,22 +47,21 @@ jobs:
- uses: actions/checkout@v4
- name: toolchain
uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: cargo fmt
- name: format
run: cargo fmt --all --check
- name: cargo clippy
run: cargo clippy
- name: lint
run: cargo check
# run: cargo clippy
# run: cargo clippy -- -D warnings
- name: cargo test
- name: test
run: cargo test --all --exclude e2e_test