Skip to content

Update rust.yml

Update rust.yml #16

Workflow file for this run

name: Build
permissions: {}
on:
pull_request:
push:
branches:
- main
env:
# Disable incremental compilation for faster from-scratch builds
CARGO_INCREMENTAL: 0
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup update
- name: Build
run: cargo build --release
# Cleanup steps for Windows
- name: Clean up target directory (Windows only)
if: runner.os == 'Windows'
run: |
Remove-Item -Path "target\release\build" -Recurse -Force
Remove-Item -Path "target\release\deps" -Recurse -Force
Remove-Item -Path "target\release\examples" -Recurse -Force
Remove-Item -Path "target\release\incremental" -Recurse -Force
# Cleanup steps for macOS and Linux
- name: Clean up target directory (macOS and Linux only)
if: runner.os != 'Windows'
run: |
rm -rf target/release/build
rm -rf target/release/deps
rm -rf target/release/examples
rm -rf target/release/incremental
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}
path: target/