chore: Add clippy and test functions to x.ps1 #5
This file contains 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
# This checks out the code, and compiles and uploads the binaries. | |
name: CD | |
on: | |
push: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: "full" | |
concurrency: | |
group: CD-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install linux dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y --no-install-recommends libasound2-dev pkg-config wget libavutil-dev libavformat-dev | |
if: contains(matrix.os, 'ubuntu') | |
- name: Set up mold linker | |
uses: rui314/setup-mold@v1 | |
- name: Install Rust toolchain | |
run: | | |
rustup show | |
rustup -V | |
rustup set profile minimal | |
rustup toolchain install stable | |
rustup override set stable | |
- name: Setup cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
save-if: ${{ github.ref == 'refs/heads/main' }} | |
- name: Build every binary | |
run: ./x.sh b | |
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') | |
- name: Build every binary | |
run: .\x.ps1 b | |
if: contains(matrix.os, 'windows') | |
- name: Upload project Binaries as artifacts | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
name: binaries-${{ runner.os }} | |
path: | | |
./target/release/mecomp-cli | |
./target/release/mecomp-tui | |
./target/release/mecomp-daemon |