From 68ef6fdc0985380447dbe53ac4a8074fedd9ae99 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Sat, 22 Aug 2020 14:32:28 -0600 Subject: [PATCH] Draft of github actions workflow for CI --- .github/workflows/ci.yml | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 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..b621655 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +name: CI checks + +on: [push, pull_request] + +jobs: + + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: 1.45.2 + override: true + + # Build the code before running cargo fmt + - name: cargo build + uses: actions-rs/cargo@v1 + with: + command: build + args: --all + + # Ensure all code has been formatted with rustfmt + - run: rustup component add rustfmt + - name: Check formatting + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check --color always + + # Build benchmarks to prevent bitrot + - name: Build benchmarks + uses: actions-rs/cargo@v1 + with: + command: build + args: --all --benches + + build_and_test: + name: Test on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: 1.45.2 + override: true + - name: Build tests + uses: actions-rs/cargo@v1 + with: + command: build + args: --verbose --release --all --tests --all-features + - name: Run tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --verbose --release --all