From 9e9c9f09800a06816986f13895fa995e761a4698 Mon Sep 17 00:00:00 2001 From: Steve Lau Date: Wed, 23 Oct 2024 11:20:08 +0800 Subject: [PATCH] ci: set up CI --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d2a9c97 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +on: + pull_request: + push: + branches: + - main + +name: CI + +jobs: + check: + name: ${{ matrix.target_name }} (check, clippy) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - target_name: Linux + os: ubuntu-latest + - target_name: macOS + os: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run cargo fmt + env: + TERM: xterm-256color + run: | + cargo +nightly fmt --all -- --check + + - name: Run cargo clippy + run: cargo clippy + + - name: Run cargo test + run: cargo test