Update Cargo.toml #14
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
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 cdylib with Cargo | |
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 | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: target/ |