diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de390ac..33a067b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: Build & Unit Test on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] env: CARGO_TERM_COLOR: always @@ -16,41 +16,41 @@ jobs: os: [macOS-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - # Install Linux-specific dependencies - - name: Install ALSA (Linux only) - if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libasound2-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev - - # Install Windows-specific dependencies - - name: Install CMake (Windows only) - if: runner.os == 'Windows' - run: choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' - - # Cache cargo build artifacts - - name: Cache cargo registry - uses: actions/cache@v2 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - - name: Cache cargo index - uses: actions/cache@v2 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }} - - - name: Cache cargo build - uses: actions/cache@v2 - with: - path: target - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - # Actual build steps - - name: Build - run: cargo build --verbose --release - working-directory: runtimes/desktop_runtime - - name: Run tests - run: cargo test --verbose - working-directory: runtimes/desktop_runtime + - uses: actions/checkout@v3 + + # Install Linux-specific dependencies + - name: Install ALSA (Linux only) + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install -y libasound2-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev ffmpeg + + # Install Windows-specific dependencies + - name: Install CMake (Windows only) + if: runner.os == 'Windows' + run: choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' + + # Cache cargo build artifacts + - name: Cache cargo registry + uses: actions/cache@v2 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo index + uses: actions/cache@v2 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo build + uses: actions/cache@v2 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + + # Actual build steps + - name: Build + run: cargo build --verbose --release + working-directory: runtimes/desktop_runtime + - name: Run tests + run: cargo test --verbose + working-directory: runtimes/desktop_runtime