diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..a03c66f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,28 @@ +name: CI +on: + push: + branches: [main, "alpha/**"] + pull_request: + branches: [main, "alpha/**"] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: ["nightly", "stable"] + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain }} + components: rustfmt, clippy + - name: Format + run: cargo fmt --check + - name: Set feat_toolchain + run: echo "feat_toolchain=$(if [[ '${{ matrix.toolchain }}' = 'stable' ]]; then printf 'stable'; fi)" >> "$GITHUB_ENV" + - name: Lint + run: cargo clippy --no-deps --no-default-features -F "$feat_toolchain" -- -Dwarnings + - name: Test + run: cargo test --no-default-features -F "$feat_toolchain"