blob: 096ba31f246bce96b7918ec0d2d43830b0fb60e7 (
plain) (
tree)
|
|
name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
platform: [x86_64, i386]
runs-on: windows-latest
name: 'Build: ${{ matrix.platform }}'
defaults:
run:
shell: pwsh
env:
platform: '${{ matrix.platform }}'
global_env: 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
user_env: 'HKCU:\Environment'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Stack
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-no-global: true
# TODO: caching.
- name: Build dependencies
run: stack --no-terminal build --arch '${{ matrix.platform }}' --only-dependencies
- name: Build
run: stack --no-terminal build --arch '${{ matrix.platform }}' --copy-bins --local-bin-path ../install
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: 'windows-env-${{ matrix.platform }}'
path: '${{ runner.workspace }}/install/'
if-no-files-found: error
- name: Run tests
run: |
$((Get-ItemProperty $env:global_env).PATH.Split(';') | Select-String -Pattern '^C:\\dumb$' -Quiet) -and $(throw "Global PATH shouldn't contain C:\dumb")
$((Get-ItemProperty $env:user_env).PATH.Split(';') | Select-String -Pattern '^C:\\dumb$' -Quiet) -and $(throw "User PATH shouldn't contain C:\dumb")
../install/addpath -y C:\dumb
$((Get-ItemProperty $env:global_env).PATH.Split(';') | Select-String -Pattern '^C:\\dumb$' -Quiet) -and $(throw "Global PATH shouldn't contain C:\dumb")
$((Get-ItemProperty $env:user_env).PATH.Split(';') | Select-String -Pattern '^C:\\dumb$' -Quiet) -or $(throw "User PATH should contain C:\dumb")
../install/addpath -g -y C:\dumb
$((Get-ItemProperty $env:global_env).PATH.Split(';') | Select-String -Pattern '^C:\\dumb$' -Quiet) -or $(throw "Global PATH should contain C:\dumb")
$((Get-ItemProperty $env:user_env).PATH.Split(';') | Select-String -Pattern '^C:\\dumb$' -Quiet) -or $(throw "User PATH should contain C:\dumb")
../install/delpath -g -y C:\dumb
$((Get-ItemProperty $env:global_env).PATH.Split(';') | Select-String -Pattern '^C:\\dumb$' -Quiet) -and $(throw "Global PATH shouldn't contain C:\dumb")
$((Get-ItemProperty $env:user_env).PATH.Split(';') | Select-String -Pattern '^C:\\dumb$' -Quiet) -and $(throw "User PATH shouldn't contain C:\dumb")
|