Skip to content

Commit

Permalink
Add test build on push
Browse files Browse the repository at this point in the history
  • Loading branch information
sirredbeard committed Jan 24, 2024
1 parent 60a8cef commit 06b56bb
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Artifacts
name: Build and Upload Artifacts on Release

on:
release:
Expand Down Expand Up @@ -33,22 +33,17 @@ jobs:
run: |
Install-Module -Name ps2exe -Scope CurrentUser -Force
- name: Install Scoop to install Nim
- name: Install Scoop, Nim and Nim dependencies
run: |
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
- name: Install Nim to compile Nim applications
run: |
scoop install nim
- name: Install Nim dependencies for Nim applications
run: |
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
scoop install 7zip git nim
nimble update -y
nimble install -y puppy
- name: Compile Nim applications
run: |
nim c -d:release -d:static -o:bin\wsl-perf.exe wslperf.nim
nim c --cc:vcc -d:release -d:static -o:wsl-perf.exe wslperf.nim
- name: Compile PowerShell scripts
run: |
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/test-build-on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test Build on Push

on:
push:

defaults:
run:
shell: powershell

jobs:
build:
runs-on: windows-latest
permissions: write-all

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Convert tag to version
id: convert_tag
run: |
$version = "${{ github.ref }}"
$version = $version.Replace('refs/tags/', '')
echo "version=$version" >> "$env:GITHUB_ENV"
echo "version=$version"
- name: Configure PowerShell
run: |
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
- name: Install ps2exe module to compile PowerShell scripts
run: |
Install-Module -Name ps2exe -Scope CurrentUser -Force
- name: Install Scoop, Nim and Nim dependencies
run: |
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
scoop install 7zip git nim
nimble update -y
nimble install -y puppy
- name: Compile Nim applications
run: |
nim c --cc:vcc -d:release -d:static -o:bin\wsl-perf.exe wslperf.nim
- name: Compile PowerShell scripts
run: |
echo "Compile version ${{ env.version }}"
Get-ChildItem -Path . -Filter '*.ps1' -Recurse -Exclude build-wslinternals.ps1,sched-wsl-dist-update.ps1 | ForEach-Object {
Invoke-ps2exe -inputFile $_.Name -verbose
}
- name: Create archive
run: |
Compress-Archive -Path .\*.exe, .\sched-wsl-dist-update.ps1 -DestinationPath "test-build.zip"
2 changes: 1 addition & 1 deletion build-wslinternals.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ foreach ($ps1File in $ps1Files) {
}

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

0 comments on commit 06b56bb

Please sign in to comment.