name: Rust

on:
  push:
    branches: ["master"]
  pull_request:
    branches: ["master"]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    runs-on: macos-latest

    steps:
      - uses: actions/checkout@v6
      - name: Build
        run: cargo build --verbose
      - name: Run tests
        run: cargo test --verbose
      - name: Upload Build Artifact
        uses: actions/upload-artifact@v6
        with:
          name: debug build
          path: target/debug/caffeinate2
          if-no-files-found: error
