Skip to content

Commit 06b56bb

Browse files
committed
Add test build on push
1 parent 60a8cef commit 06b56bb

File tree

3 files changed

+62
-11
lines changed

3 files changed

+62
-11
lines changed

.github/workflows/release-artifacts.yml renamed to .github/workflows/build-on-release.yml

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release Artifacts
1+
name: Build and Upload Artifacts on Release
22

33
on:
44
release:
@@ -33,22 +33,17 @@ jobs:
3333
run: |
3434
Install-Module -Name ps2exe -Scope CurrentUser -Force
3535
36-
- name: Install Scoop to install Nim
36+
- name: Install Scoop, Nim and Nim dependencies
3737
run: |
3838
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
39-
40-
- name: Install Nim to compile Nim applications
41-
run: |
42-
scoop install nim
43-
44-
- name: Install Nim dependencies for Nim applications
45-
run: |
39+
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
40+
scoop install 7zip git nim
4641
nimble update -y
4742
nimble install -y puppy
4843
4944
- name: Compile Nim applications
5045
run: |
51-
nim c -d:release -d:static -o:bin\wsl-perf.exe wslperf.nim
46+
nim c --cc:vcc -d:release -d:static -o:wsl-perf.exe wslperf.nim
5247
5348
- name: Compile PowerShell scripts
5449
run: |
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Test Build on Push
2+
3+
on:
4+
push:
5+
6+
defaults:
7+
run:
8+
shell: powershell
9+
10+
jobs:
11+
build:
12+
runs-on: windows-latest
13+
permissions: write-all
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v2
18+
19+
- name: Convert tag to version
20+
id: convert_tag
21+
run: |
22+
$version = "${{ github.ref }}"
23+
$version = $version.Replace('refs/tags/', '')
24+
echo "version=$version" >> "$env:GITHUB_ENV"
25+
echo "version=$version"
26+
27+
- name: Configure PowerShell
28+
run: |
29+
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
30+
31+
- name: Install ps2exe module to compile PowerShell scripts
32+
run: |
33+
Install-Module -Name ps2exe -Scope CurrentUser -Force
34+
35+
- name: Install Scoop, Nim and Nim dependencies
36+
run: |
37+
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
38+
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
39+
scoop install 7zip git nim
40+
nimble update -y
41+
nimble install -y puppy
42+
43+
- name: Compile Nim applications
44+
run: |
45+
nim c --cc:vcc -d:release -d:static -o:bin\wsl-perf.exe wslperf.nim
46+
47+
- name: Compile PowerShell scripts
48+
run: |
49+
echo "Compile version ${{ env.version }}"
50+
Get-ChildItem -Path . -Filter '*.ps1' -Recurse -Exclude build-wslinternals.ps1,sched-wsl-dist-update.ps1 | ForEach-Object {
51+
Invoke-ps2exe -inputFile $_.Name -verbose
52+
}
53+
54+
- name: Create archive
55+
run: |
56+
Compress-Archive -Path .\*.exe, .\sched-wsl-dist-update.ps1 -DestinationPath "test-build.zip"

build-wslinternals.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ foreach ($ps1File in $ps1Files) {
4444
}
4545

4646
# Compile wslperf.nim to wsl-perf.exe
47-
nim c -d:release -d:static -o:bin\wsl-perf.exe wslperf.nim
47+
nim c --cc:vcc -d:release -d:static -o:bin\wsl-perf.exe wslperf.nim

0 commit comments

Comments
 (0)