Some refinement to the gh-workflow

This commit is contained in:
Edward R. Gonzalez 2023-03-30 19:34:07 -04:00
parent a0a3e42e6a
commit 018286be6f

View File

@ -1,53 +1,84 @@
# Name of the workflow
name: Build name: Build
# Events used by github actions to know when to execute this workflow
on: on:
push: push:
branches: branches:
- main - main
pull_request: pull_request:
branches: branches:
- main - main
workflow_dispatch: workflow_dispatch:
inputs: inputs:
type: type:
description: 'Meson buildtype (release, debug, etc.)' description: 'Meson buildtype (release, debug, etc.)'
required: false required: false
test: test:
description: 'Run tests (test)' description: 'Run tests (test)'
required: false required: false
jobs: jobs:
build: build:
runs-on: windows-latest runs-on:
windows-latest
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install Meson, Ninja, and Clang with Chocolatey
- name: Install Meson, Ninja, and Clang with Chocolatey and pip
shell: pwsh shell: pwsh
run: | run: |
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
Set-ExecutionPolicy Bypass -Scope Process -Force if (-not (Get-Command choco -ErrorAction SilentlyContinue))
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) {
choco install -y python ninja llvm Set-ExecutionPolicy Bypass -Scope Process -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
}
if (-not (choco list --local-only | Select-String "python"))
{
choco install -y python
}
if (-not (choco list --local-only | Select-String "ninja"))
{
choco install -y ninja
}
if (-not (choco list --local-only | Select-String "llvm"))
{
choco install -y llvm
}
python -m pip install meson python -m pip install meson
- name: Run PowerShell build script - name: Run PowerShell build script
shell: pwsh shell: pwsh
# env:
# CC: clang env:
# CXX: clang++ CC: clang
# BUILD_TYPE: ${{ github.event.inputs.type }} CXX: clang++
# RUN_TESTS: ${{ github.event.inputs.test }} BUILD_TYPE: ${{ github.event.inputs.type }}
RUN_TESTS: ${{ github.event.inputs.test }}
run: | run: |
# $ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
# $type = $env:BUILD_TYPE $type = $env:BUILD_TYPE
# $test = $env:RUN_TESTS $test = $env:RUN_TESTS
# $args = @() $args = @()
# if (-not [string]::IsNullOrEmpty($type)) { $args += $type } if (-not [string]::IsNullOrEmpty($type)) { $args += $type }
# if (-not [string]::IsNullOrEmpty($test)) { $args += $test } if (-not [string]::IsNullOrEmpty($test)) { $args += $test }
& .\scripts\build.ps1 debug test & .\scripts\build.ps1 debug test