Modernize CI process. #169
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 | |
| 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: nightly-2025-07-22 | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - run: cargo install cargo-nextest | |
| - run: cargo nextest run --features ml | |
| 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: nightly-2025-07-22 | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - run: cargo install cargo-llvm-cov | |
| - run: cargo install cargo-nextest | |
| - run: cargo llvm-cov nextest --features ml --workspace --lcov --output-path coverage.lcov | |
| - 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: nightly-2025-07-22 | |
| - 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: | | |
| RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" \ | |
| cargo build --target x86_64-unknown-linux-gnu --release | |
| - 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: nightly-2025-07-22 | |
| targets: x86_64-pc-windows-gnu | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - run: cargo build --target x86_64-pc-windows-gnu --release | |
| - 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: Swatinem/rust-cache@v2 | |
| with: | |
| cache-all-crates: "true" | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| toolchain: nightly-2025-07-22 | |
| targets: aarch64-apple-darwin | |
| - run: cargo build --target aarch64-apple-darwin --release | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: kord_aarch64-apple-darwin | |
| path: target/aarch64-apple-darwin/release/kord |