From 12280adc9d8de4954831f6b4655e08f2a155ac46 Mon Sep 17 00:00:00 2001 From: Heiko Seeberger Date: Wed, 8 Jun 2022 07:21:03 +0200 Subject: [PATCH] build: add GitHub action for testing --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..27c5be6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Check out + uses: actions/checkout@v3 + - name: Update Rust + run: | + rustup update + rustup toolchain install nightly + rustup component add rustfmt --toolchain nightly + - name: Set up cargo cache + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + - name: Check code formatting + run: cargo +nightly fmt --all --check + - name: Lint + run: cargo clippy -- -D warnings + - name: Test + run: cargo test