Skip to content

Commit

Permalink
cicd: introduce CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hhs629629 committed Sep 28, 2023
1 parent 4a0db0f commit 5d726e6
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

env:
CARGO_TERM_COLOR: always

jobs:
format:
name: rustfmt
runs-on: [windows-latest, macos-latest, ubuntu-latest]

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install toolchain
uses: dtolnay/[email protected]
with:
components: rustfmt

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Run cargo fmt
run: cargo fmt --all -- --check

test:
name: cargo test
runs-on: [windows-latest, macos-latest, ubuntu-latest]

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Install cargo-nextest
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-nextest
locked: true
cache-key: ${{ runner.arch }}_${{ runner.os }}

- name: Run tests
run: cargo nextest run --all-targets --all-features

0 comments on commit 5d726e6

Please sign in to comment.