Skip to content

Build native Windows #13

Build native Windows

Build native Windows #13

name: Build native Windows
on:
workflow_call:
inputs:
profiles:
type: string
required: true
workflow_dispatch:
inputs:
profiles:
type: string
default: '[{ "name": "debug", "flags": "" }]'
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short
TERM: xterm-256color
jobs:
win-native:
runs-on: ci-win
strategy:
matrix:
profiles: ${{ fromJson(inputs.profiles) }}
fail-fast: false
name: win-native (${{ matrix.profiles.name }})
defaults:
run:
shell: msys2 {0}
steps:
- name: "ACTIONS: Checkout"
uses: actions/checkout@v4
- name: "Install: Setup MSYS2 environment"
uses: msys2/setup-msys2@v2
with:
path-type: inherit
install: >-
procps
mingw-w64-x86_64-protobuf
mingw-w64-x86_64-wabt
mingw-w64-x86_64-binaryen
- name: "Install: Packages from Scoop"
uses: MinoruSekine/[email protected]
with:
apps: perl
- name: "Install: Rustup"
run: |
Invoke-WebRequest -OutFile rustup-init.exe https://win.rustup.rs/x86_64
.\rustup-init.exe -y
Remove-Item rustup-init.exe
shell: powershell
- name: "Install: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1
- name: "ACTIONS: Setup caching"
uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.profiles.name }}"
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: "Install: cargo-nextest"
run: |
$tmp = "cargo-nextest.zip"
Invoke-WebRequest -OutFile $tmp https://get.nexte.st/latest/windows
$outputDir = if ($Env:CARGO_HOME) { Join-Path $Env:CARGO_HOME "bin" } else { "~/.cargo/bin" }
$tmp | Expand-Archive -DestinationPath $outputDir -Force
$tmp | Remove-Item
shell: powershell
- name: "Install: cargo-hack"
run: |
$tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'tar.gz' } -PassThru
Invoke-WebRequest -OutFile $tmp https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-pc-windows-msvc.tar.gz
$outputDir = if ($Env:CARGO_HOME) { Join-Path $Env:CARGO_HOME "bin" } else { Resolve-Path "~/.cargo/bin" }
tar zxf $tmp -C $outputDir
$tmp | Remove-Item
shell: powershell
- name: "Build: Node"
run: ./scripts/gear.sh build node --release --locked
- name: "Check: Stack height limit"
# no need to run check twice
if: ${{ matrix.profiles.name == 'release' }}
run: cargo run -p calc-stack-height --release --locked
- name: "Test: gsdk tests"
run: ./scripts/gear.sh test gsdk ${{ matrix.profiles.flags }}
- name: "Test: Client tests"
run: ./scripts/gear.sh test client ${{ matrix.profiles.flags }}
- name: "Test: Lazy pages"
run: >-
cargo nextest run
-p "pallet-*"
-p gear-lazy-pages
-p gear-runtime-interface
${{ matrix.profiles.flags }}