From b8135b71c41f20025d39eeee28759061a1f1f059 Mon Sep 17 00:00:00 2001 From: Yu Chen Date: Mon, 2 Aug 2021 10:23:35 +0800 Subject: [PATCH] add main.yml for code --- .github/workflows/main.yml | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 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 0000000..399932d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,62 @@ +name: CI + +jobs: + check: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2021-07-27 + override: true + components: rustfmt, clippy + - name: Check code format + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + - name: Clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, macos-latest] + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2021-07-27 + components: rust-src + - name: Build + run: | + cd code + cargo build +# uses: actions-rs/cargo@v1 +# with: +# command: build + + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, macos-latest] + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2021-07-27 + components: rust-src + - name: Test + run: | + cd code + cargo test