diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..6fa0d49 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,67 @@ +name: Check + +on: + push: + pull_request: + +jobs: + clippy: + name: Clippy (${{ matrix.name }}) + runs-on: ${{ matrix.os }} + permissions: + contents: read + strategy: + fail-fast: false + matrix: + include: + - name: Windows + os: windows-latest + target: x86_64-pc-windows-msvc + - name: Linux + os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - name: macOS + os: macos-14 + target: aarch64-apple-darwin + + steps: + - uses: actions/checkout@v4 + + - name: Setup Rust toolchain + run: | + rustup toolchain install + rustup target add ${{ matrix.target }} + + - name: Cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: "true" + cache-all-crates: "true" + + - name: Clippy + run: | + cd mmover + cargo clippy --all-targets --all-features --workspace --target ${{ matrix.target }} -- -D warnings + + tests: + name: Tests + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + + - name: Setup Rust toolchain + run: rustup toolchain install + + - name: Cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: "true" + cache-all-crates: "true" + + - name: Run tests + run: | + cd mmover + cargo test --all