diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..712e0b4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + build: + name: Build (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + rust: [stable] + include: + - os: ubuntu-latest + rust: beta + - os: macos-latest + rust: beta + - os: windows-latest + rust: beta + + steps: + - uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + components: rustfmt + + - name: Check formatting + run: cargo fmt -- --check + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose diff --git a/Cargo.toml b/Cargo.toml index 83e0bb2..871700f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,9 @@ jwalk = "0.5" structopt = "0.3" filesize = "0.2.0" unicode-width = "0.1.7" +[target.'cfg(not(target_os = "windows"))'.dependencies] nix = "0.17.0" + [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["securitybaseapi","debugapi"] }