Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): Use debug & release profiles #3616

Merged
merged 64 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
c28a54c
Debug assertions in CI
ark0f Dec 22, 2023
3f0be4a
Fix `gear-wasm-builder`
ark0f Dec 22, 2023
119e41b
Fix target paths
ark0f Dec 22, 2023
9d6b4b5
Change `--profile` to `--cargo-profile` for nextest
ark0f Dec 22, 2023
81cd3ee
Fix gsdk tests
ark0f Dec 22, 2023
fe0ad6f
Fix gcli tests
ark0f Dec 22, 2023
b891898
Fix `clap` in `gcli` binary
ark0f Dec 22, 2023
10a14be
Fix gclient tests
ark0f Dec 23, 2023
07789ff
Use `debug` profile by default
ark0f Dec 24, 2023
edd4bdf
Run `calc-stack-height` in release
ark0f Dec 24, 2023
789bdd5
Merge remote-tracking branch 'origin/master' into al/debug-build-ci
ark0f Feb 5, 2024
f2b2bd8
Revert obsolete files
ark0f Feb 5, 2024
899bf9c
Build node in release in `CI.yml`
ark0f Feb 5, 2024
853ed36
Build node in separated step
ark0f Feb 5, 2024
2c61163
Test matrix
ark0f Feb 5, 2024
15c62d5
Apply matrix values to steps
ark0f Feb 5, 2024
9484332
Use args instead of profile names
ark0f Feb 5, 2024
106cc69
Merge remote-tracking branch 'origin/master' into al/debug-build-ci
ark0f Feb 7, 2024
74717e8
Remove short flag for `vanity` arg
ark0f Feb 7, 2024
04fafb9
Propagate matrix to other OS builds
ark0f Feb 7, 2024
ebbb1cc
Always build `win-cross` in debug
ark0f Feb 7, 2024
2eaedaf
Run native Windows build on label
ark0f Feb 7, 2024
6046df7
Propagate matrix to native Windows build
ark0f Feb 7, 2024
3b919fc
Uncomment lines
ark0f Feb 7, 2024
d338cae
Revert "Always build `win-cross` in debug"
ark0f Feb 7, 2024
318edbc
Run matrix step on default GH runner
ark0f Feb 7, 2024
7556eac
Fix missing output
ark0f Feb 7, 2024
95fc2ec
Set jobs' names
ark0f Feb 7, 2024
d8bef92
Double deadline in authorship tests
ark0f Feb 7, 2024
dca9aee
Build in release on label
ark0f Feb 7, 2024
8b1d1b9
Merge remote-tracking branch 'origin/master' into al/debug-build-ci
ark0f Feb 7, 2024
b443d26
Fix bash formatting
ark0f Feb 8, 2024
36fe884
Build production binaries only when release profile activated
ark0f Feb 8, 2024
685aa33
Use release node in `gcli` tests
ark0f Feb 8, 2024
8b944e5
Fix clippy warnings
ark0f Feb 8, 2024
bfe5950
Add missing feature for `common` in `gear-voucher`
ark0f Feb 8, 2024
a743b85
Make benchmark unit test listing consistent
ark0f Feb 8, 2024
5194f91
Run full benchmark test in release build only
ark0f Feb 8, 2024
69a7e1e
Set deadline to 10s in authorship tests
ark0f Feb 8, 2024
8b488b7
Make `win-native` and `macos` jobs cancelable
ark0f Feb 8, 2024
6fc0ba0
Set deadline to 1 minute in authorship tests
ark0f Feb 8, 2024
94eefbd
Wrap if conditions in braces
ark0f Feb 9, 2024
06c0e66
Merge remote-tracking branch 'origin/master' into al/debug-build-ci
ark0f Feb 9, 2024
8d4612a
Use `contains` to workaround GH actions bug
ark0f Feb 9, 2024
a563172
Merge remote-tracking branch 'origin/master' into al/debug-build-ci
ark0f Feb 12, 2024
5166b01
Don't compare boolean with strings
ark0f Feb 12, 2024
568e0e5
Fix WASM benchmarks started in debug build
ark0f Feb 12, 2024
b6b5054
Rename matrix variables
ark0f Feb 12, 2024
f6552eb
Fix not only benchmark tests run
ark0f Feb 12, 2024
79494de
Fix wrong matrix field used
ark0f Feb 12, 2024
4ee0273
Merge remote-tracking branch 'origin/master' into al/debug-build-ci
ark0f Feb 12, 2024
ffd626d
Fix comparison value
ark0f Feb 12, 2024
3c7f2a1
Fix profile flags are not used in native Windows build
ark0f Feb 12, 2024
4b88e25
Don't run some steps in debug
ark0f Feb 12, 2024
124f64c
Merge remote-tracking branch 'origin/master' into al/debug-build-ci
ark0f Mar 12, 2024
03ddf57
Remove obsolete branches
ark0f Mar 12, 2024
2e5657f
Remove obsolete caching
ark0f Mar 12, 2024
fda41e9
Revert authorship tests
ark0f Mar 12, 2024
5e7960b
Describe outputs
ark0f Mar 12, 2024
91587f6
Fix main.js
ark0f Mar 12, 2024
de11456
Rename workflow
ark0f Mar 12, 2024
ff220ea
Rename job
ark0f Mar 12, 2024
b286db9
Merge remote-tracking branch 'origin/master' into al/debug-build-ci
ark0f Mar 12, 2024
23b5dec
Merge branch 'master' into al/debug-build-ci
ark0f Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/actions/message/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const github = require('@actions/github');
const BUILD_LABELS = ["A0-pleasereview", 'A4-insubstantial', 'A2-mergeoncegreen'];
const CHECKS = ["check", "build"]
const DEPBOT = "[depbot]";
const WINDOWS_NATIVE = "E1-forcenatwin";
const MACOS = "E2-forcemacos";
const RELEASE = "E3-forcerelease"
const SCCACHE_PREFIX = '/mnt/sccache/';
const SKIP_CI = "[skip-ci]";
const SKIP_CACHE = "[skip-cache]";
Expand Down Expand Up @@ -64,20 +66,26 @@ async function main() {
const skipCache = [title, message].some(s => s.includes(SKIP_CACHE));
const skipCI = [title, message].some(s => s.includes(SKIP_CI));
const build = !skipCI && (isDepbot || BUILD_LABELS.some(label => labels.includes(label)));
const win_native = !skipCI && labels.includes(WINDOWS_NATIVE);
const macos = !skipCI && labels.includes(MACOS);
const release = !skipCI && labels.includes(RELEASE);
const cache = SCCACHE_PREFIX + branch.replace("/", "_");

// Set outputs
core.setOutput("build", build);
core.setOutput("check", !skipCI);
core.setOutput("win-native", win_native);
core.setOutput("macos", macos);
core.setOutput("release", release);
!skipCache && core.setOutput("cache", cache)

console.log("---");
console.log("build: ", build);
console.log("cache: ", skipCache ? "false" : cache);
console.log("check: ", !skipCI);
console.log("native windows: ", win_native);
console.log("macos: ", macos);
console.log("release: ", release);

// Mock checks if skipping CI.
if (skipCI) await mock(sha);
Expand Down
86 changes: 2 additions & 84 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,90 +59,8 @@ jobs:
with:
ark0f marked this conversation as resolved.
Show resolved Hide resolved
cache: ${{ needs.cache.outputs.sccache_path }}
macos: true

build-win-native:
if: ${{ github.ref == 'refs/heads/master' }}
needs: build
runs-on: ci-win
defaults:
run:
shell: msys2 {0}
env:
CARGO_INCREMENTAL: 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: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1

- 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"
run: cargo run -p calc-stack-height --release --locked

- name: "Test: gsdk tests"
run: ./scripts/gear.sh test gsdk --release

- name: "Test: Client tests"
run: ./scripts/gear.sh test client --release

- name: "Test: Lazy pages"
run: >-
cargo nextest run
-p "pallet-*"
-p gear-lazy-pages
-p gear-runtime-interface
--release
win-native: true
release: true

upload:
if: github.event_name == 'push' && github.ref_name == 'master'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ jobs:
build: ${{ steps.config.outputs.build }}
cache: ${{ steps.config.outputs.cache }}
check: ${{ steps.config.outputs.check }}
win-native: ${{ steps.config.outputs.win-native }}
macos: ${{ steps.config.outputs.macos }}
release: ${{ steps.config.outputs.release }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -51,3 +53,5 @@ jobs:
with:
cache: ${{ needs.status.outputs.cache }}
macos: ${{ needs.status.outputs.macos == 'true' }}
win-native: ${{ needs.status.outputs.win-native == 'true' }}
release: ${{ needs.status.outputs.release == 'true' }}
18 changes: 16 additions & 2 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build MacOS

on:
workflow_call:
inputs:
matrix:
type: string
required: true
workflow_dispatch:

env:
Expand All @@ -12,8 +16,12 @@ env:
BINARYEN_VERSION: version_111

jobs:
x86:
macos-x86:
runs-on: macos-latest
strategy:
matrix: ${{ fromJson(inputs.matrix) }}
fail-fast: false
name: macos-x86 (${{ matrix.profile }})
env:
RUSTUP_HOME: /tmp/rustup_home
steps:
Expand Down Expand Up @@ -43,9 +51,14 @@ jobs:
run: curl -LsSf https://get.nexte.st/latest/mac | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin

- name: "Build: Node"
run: cargo build -p gear-cli
# node is not actually used in the following test sequence
# so we just check compilation
if: ${{ matrix.profile == 'release' }}
run: cargo build -p gear-cli --release --locked

- name: "Check: Stack height limit"
# no need to run check twice
if: ${{ matrix.profile == 'release' }}
run: cargo run -p calc-stack-height --release --locked

- name: "Test: Lazy pages"
Expand All @@ -54,3 +67,4 @@ jobs:
-p "pallet-*"
-p gear-lazy-pages
-p gear-runtime-interface
${{ matrix.profile_flags }}
105 changes: 105 additions & 0 deletions .github/workflows/build-win-native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build MacOS
ark0f marked this conversation as resolved.
Show resolved Hide resolved

on:
workflow_call:
inputs:
matrix:
type: string
required: true
workflow_dispatch:

env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short
TERM: xterm-256color
BINARYEN_VERSION: version_111

jobs:
win-native:
runs-on: ci-win
strategy:
matrix: ${{ fromJson(inputs.matrix) }}
fail-fast: false
name: win-native (${{ matrix.profile }})
defaults:
run:
shell: msys2 {0}
env:
CARGO_INCREMENTAL: 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: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1

- 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.profile == 'release' }}
run: cargo run -p calc-stack-height --release --locked

- name: "Test: gsdk tests"
run: ./scripts/gear.sh test gsdk ${{ matrix.profile_flags }}

- name: "Test: Client tests"
run: ./scripts/gear.sh test client ${{ matrix.profile_flags }}

- name: "Test: Lazy pages"
NikVolf marked this conversation as resolved.
Show resolved Hide resolved
run: >-
cargo nextest run
-p "pallet-*"
-p gear-lazy-pages
-p gear-runtime-interface
${{ matrix.profile_flags }}
Loading
Loading