Skip to content

[FIX] Free space for Ubuntu runner #885

[FIX] Free space for Ubuntu runner

[FIX] Free space for Ubuntu runner #885

Workflow file for this run

name: "CI/CD"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ] # macos tends to break more often.
continue-on-error: false
steps:
- name: Free Disk Space (Ubuntu)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Setup rust-cache
uses: Swatinem/rust-cache@v2
- name: Install winget
if: runner.os == 'Windows'
uses: Cyberboss/install-winget@v1
# Fail cheaply and early if the code is not even formatted correctly.
- name: Cargo fmt check
run: cargo fmt --all -- --check
## System dependencies
# Install dependencies only on Linux
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libudev-dev libpcap-dev
# Those are needed for the integration tests on Windows
- name: Download Npcap SDK (Windows)
if: runner.os == 'Windows'
run: |
Invoke-WebRequest -Uri https://npcap.com/dist/npcap-sdk-1.13.zip -OutFile npcap-sdk.zip
Expand-Archive -Path npcap-sdk.zip -DestinationPath $env:USERPROFILE\npcap-sdk
Remove-Item npcap-sdk.zip
winget install --id DaiyuuNobori.Win10Pcap --disable-interactivity --accept-source-agreements --accept-package-agreements
- name: Set Library and Include Paths (Windows)
if: runner.os == 'Windows'
run: |
$npcapLibDir = "$env:USERPROFILE\npcap-sdk\Lib\x64"
Add-Content -Path $env:GITHUB_ENV -Value "LIB=$npcapLibDir"
## End of system dependencies
# This is also relatively quick to do, so let's fail early.
- name: Run clippy in debug
if: runner.os == 'Linux'
run: cargo clippy --workspace --all-targets -- --deny warnings
- name: Run clippy in release
if: runner.os == 'Linux'
run: cargo clippy --release --workspace --all-targets -- --deny warnings
# - name: Install cargo-generate
# run: cargo install cargo-generate
- name: Build vanilla
run: |
cargo build --workspace --features macro_debug
- name: Build with mocks
run: |
cargo build --workspace --features mock
- name: Run tests
env:
LIB: ${{env.LIB}}
run: cargo test --workspace
# Integration Test for the 1 liner generation of a project.
# - name: Generate a test project from the repo template
# run: |
# cd templates
# cargo generate -p cu_full --name test_project --destination . -d copper_source=local --silent
# - name: Compile generated project
# run: |
# cd templates/test_project
# cargo build --release