Optionally support JACK #24
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust | |
| on: | |
| push: | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| defaults: | |
| run: | |
| # necessary for windows | |
| shell: bash | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libasound2-dev | |
| - name: Cargo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ./target | |
| key: test-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| - name: List | |
| run: find ./ | |
| - name: Run tests | |
| run: cargo test --verbose | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - TARGET: x86_64-unknown-linux-gnu | |
| OS: ubuntu-latest | |
| - TARGET: x86_64-apple-darwin | |
| OS: macos-latest | |
| - TARGET: x86_64-pc-windows-msvc | |
| OS: windows-latest | |
| needs: test | |
| runs-on: ${{ matrix.OS }} | |
| env: | |
| NAME: rusty-pipes | |
| TARGET: ${{ matrix.TARGET }} | |
| OS: ${{ matrix.OS }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cargo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ./target | |
| key: build-cargo-registry-${{ matrix.TARGET }}-${{ hashFiles('**/Cargo.lock') }} | |
| - name: List | |
| run: find ./ | |
| - name: Install dependencies | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libasound2-dev | |
| - name: Install rust target | |
| run: rustup target add $TARGET | |
| - name: Run build | |
| run: cargo build --release --verbose --target $TARGET | |
| - name: Install zip | |
| if: runner.os == 'Windows' | |
| run: choco install zip | |
| - name: List target | |
| run: find ./target | |
| - name: Compress | |
| run: | | |
| mkdir -p ./artifacts | |
| if [[ $GITHUB_REF_TYPE =~ ^tag$ ]]; then | |
| TAG=$GITHUB_REF_NAME | |
| else | |
| TAG=$GITHUB_SHA | |
| fi | |
| if [[ $OS =~ ^windows.*$ ]]; then | |
| EXEC=$NAME.exe | |
| mv ./target/$TARGET/release/$EXEC ./$EXEC | |
| # Use 'zip' for Windows | |
| zip ./artifacts/$NAME-$TARGET-$TAG.zip $EXEC readme.md LICENSE | |
| else | |
| EXEC=$NAME | |
| mv ./target/$TARGET/release/$EXEC ./$EXEC | |
| # Use 'tar' for Linux/macOS | |
| tar -czf ./artifacts/$NAME-$TARGET-$TAG.tar.gz $EXEC readme.md LICENSE | |
| fi | |
| - name: Archive artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: result-${{ matrix.TARGET }} | |
| path: | | |
| ./artifacts | |
| deploy: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./artifacts | |
| - name: List | |
| run: find ./artifacts | |
| - name: Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| ./artifacts/*/*.tar.gz | |
| ./artifacts/*/*.zip |