diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..dccecbe --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,51 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test on ${{ matrix.os }} (using rustc ${{ matrix.rust }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + rust: + - nightly + os: + - ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + + - name: Setup cargo-make + uses: davidB/rust-cargo-make@v1 + + - name: Cargo generate-lockfile + run: cargo generate-lockfile + + - name: Cargo cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} + + - name: Run tests with all features + run: cargo make ci +