ci: authenticate cargo-binstall to fix flaky cargo-make installs #305
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
| on: [push] | |
| name: Build and Test | |
| env: | |
| RUST_TOOLCHAIN: nightly-2025-12-22 | |
| # Authenticate cargo-binstall's GitHub API calls so concurrent build jobs | |
| # don't exhaust the unauthenticated rate limit (which intermittently left | |
| # cargo-make uninstalled -> "no such command: make"). | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install libasound2-dev | |
| run: sudo apt-get install libasound2-dev | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| toolchain: ${{ env.RUST_TOOLCHAIN }} | |
| - uses: cargo-bins/cargo-binstall@main | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - run: cargo binstall cargo-make --no-confirm | |
| - run: cargo make test-all | |
| codecov: | |
| needs: test | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install libasound2-dev | |
| run: sudo apt-get install libasound2-dev | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| toolchain: ${{ env.RUST_TOOLCHAIN }} | |
| - uses: cargo-bins/cargo-binstall@main | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - run: cargo binstall cargo-make --no-confirm | |
| - run: cargo make codecov | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: twitchax/kord | |
| build_linux: | |
| needs: test | |
| name: Build Linux | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install libasound2-dev | |
| run: sudo apt-get install libasound2-dev | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| toolchain: ${{ env.RUST_TOOLCHAIN }} | |
| - uses: cargo-bins/cargo-binstall@main | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - name: Install mold linker | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang mold | |
| - run: cargo binstall cargo-make --no-confirm | |
| - run: cargo make build-linux | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: kord_x86_64-unknown-linux-gnu | |
| path: target/x86_64-unknown-linux-gnu/release/kord | |
| build_windows: | |
| needs: test | |
| name: Build Windows | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install windows dependencies | |
| run: sudo apt-get install mingw-w64 cmake | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| toolchain: ${{ env.RUST_TOOLCHAIN }} | |
| targets: x86_64-pc-windows-gnu | |
| - uses: cargo-bins/cargo-binstall@main | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - run: cargo binstall cargo-make --no-confirm | |
| - run: cargo make build-windows | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: kord_x86_64-pc-windows-gnu | |
| path: target/x86_64-pc-windows-gnu/release/kord.exe | |
| build_macos: | |
| needs: test | |
| name: Build MacOS | |
| runs-on: macos-14 | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| toolchain: ${{ env.RUST_TOOLCHAIN }} | |
| targets: aarch64-apple-darwin | |
| - uses: cargo-bins/cargo-binstall@main | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - run: cargo binstall cargo-make --no-confirm | |
| - run: cargo make build-macos | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: kord_aarch64-apple-darwin | |
| path: target/aarch64-apple-darwin/release/kord | |
| build_wasm: | |
| needs: test | |
| name: Build WASM | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| toolchain: ${{ env.RUST_TOOLCHAIN }} | |
| targets: wasm32-wasip2 | |
| - uses: cargo-bins/cargo-binstall@main | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - run: cargo binstall cargo-make --no-confirm | |
| - run: cargo make build-oci | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: kord_wasm32-wasip2 | |
| path: target/wasm32-wasip2/release/kord.wasm |