-
Notifications
You must be signed in to change notification settings - Fork 105
120 lines (104 loc) · 4.15 KB
/
build-win-native.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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
BINARYEN_VERSION: version_111
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
- 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 = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'zip' } -PassThru
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: "Install: binaryen"
run: |
$tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'tar.gz' } -PassThru
Invoke-WebRequest -OutFile $tmp "https://github.com/WebAssembly/binaryen/releases/download/$Env:BINARYEN_VERSION/binaryen-$Env:BINARYEN_VERSION-x86_64-windows.tar.gz"
$outputDir = if ($Env:CARGO_HOME) { Join-Path $Env:CARGO_HOME "bin" } else { "~/.cargo/bin" }
tar zxf $tmp
cp "./binaryen-$Env:BINARYEN_VERSION/bin/*" $outputDir
Remove-Item -Recurse "./binaryen-$Env:BINARYEN_VERSION"
$tmp | Remove-Item
shell: powershell
- name: "Install: wabt"
run: |
$tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'tar.gz' } -PassThru
Invoke-WebRequest -OutFile $tmp https://github.com/WebAssembly/wabt/releases/download/1.0.29/wabt-1.0.29-windows.tar.gz
$outputDir = if ($Env:CARGO_HOME) { Join-Path $Env:CARGO_HOME "bin" } else { "~/.cargo/bin" }
tar zxf $tmp
cp ./wabt-1.0.29/bin/* $outputDir
Remove-Item -Recurse ./wabt-1.0.29
$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 }}