From 7abfce6ef50aeeccdb81802a554fa79ba1cfb812 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Sat, 5 Jun 2021 00:43:53 +0800 Subject: [PATCH] (chore) setup github ci --- .github/workflows/main.yml | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..beef77c9e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,54 @@ +name: CI +on: + # Only run when merging to master, or open/synchronize/reopen a PR. + push: + branches: + - master + pull_request: + +jobs: + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + build: [stable, beta, nightly, macos, windows, msrv] + include: + - build: stable + os: ubuntu-latest + rust: stable + - build: beta + os: ubuntu-latest + rust: beta + - build: nightly + os: ubuntu-latest + rust: nightly + - build: macos + os: macos-latest + rust: stable + - build: windows + os: windows-latest + rust: stable + - build: msrv + os: ubuntu-latest + rust: 1.45.0 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + components: clippy + override: true + - name: Lint + run: cargo clippy --all-features + - name: Build and run tests + run: cargo test --all-features + + rustfmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Install Rust + run: rustup update stable && rustup default stable && rustup component add rustfmt + - run: cargo fmt -- --check