448b #27
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build project | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - windows-2025 | |
| - windows-2022 | |
| - windows-2019 | |
| toolchain: | |
| - stable | |
| - nightly | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Setup ${{ matrix.toolchain }} toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| components: clippy, rustfmt | |
| - name: Cargo build | |
| run: cargo build --release | |
| - name: Cargo clippy | |
| run: cargo clippy --release -- -D warnings | |
| - name: Cargo fmt | |
| run: cargo fmt -- --check | |
| - name: Test execution | |
| run: | | |
| $target = Get-Location | |
| $job = Start-Job -ScriptBlock { | |
| param ($target) | |
| & "${target}\target\release\min-sized-rust-windows.exe" | |
| } -ArgumentList $target | |
| $state = Wait-Job $job -Timeout 10 | |
| $out = Receive-Job $job | |
| if ($out -ne "Hello World!") { | |
| Throw "Output did not equal ``Hello World!``, got ``$out``." | |
| } | |
| - name: Get size | |
| run: (Get-Item ".\target\release\min-sized-rust-windows.exe").Length |