name: CI on: push: branches: [main] tags: ['v*'] pull_request: branches: [main] env: CARGO_TERM_COLOR: always concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: strategy: fail-fast: false matrix: include: - os: ubuntu-latest target: x86_64-unknown-linux-gnu artifact: cagire-linux-x86_64 - os: macos-15-intel target: x86_64-apple-darwin artifact: cagire-macos-x86_64 - os: macos-14 target: aarch64-apple-darwin artifact: cagire-macos-aarch64 - os: windows-latest target: x86_64-pc-windows-msvc artifact: cagire-windows-x86_64 runs-on: ${{ matrix.os }} timeout-minutes: 30 steps: - uses: actions/checkout@v4 with: submodules: recursive - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} components: clippy - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 with: key: ${{ matrix.target }} - name: Install dependencies (Linux) if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install -y build-essential cmake pkg-config libasound2-dev libclang-dev libjack-dev - name: Install dependencies (macOS) if: runner.os == 'macOS' run: brew list cmake &>/dev/null || brew install cmake - name: Install dependencies (Windows) if: runner.os == 'Windows' run: | choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' echo "C:\Program Files\CMake\bin" >> $env:GITHUB_PATH - name: Build run: cargo build --release --target ${{ matrix.target }} - name: Run tests run: cargo test --target ${{ matrix.target }} - name: Run clippy run: cargo clippy --target ${{ matrix.target }} -- -D warnings - name: Upload artifact (Unix) if: runner.os != 'Windows' uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact }} path: target/${{ matrix.target }}/release/cagire - name: Upload artifact (Windows) if: runner.os == 'Windows' uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact }} path: target/${{ matrix.target }}/release/cagire.exe release: needs: build if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: write steps: - name: Download all artifacts uses: actions/download-artifact@v4 with: path: artifacts - name: Create Release uses: softprops/action-gh-release@v2 with: files: artifacts/**/* generate_release_notes: true