2023-03-30 15:02:57 -07:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
type:
|
|
|
|
description: 'Meson buildtype (release, debug, etc.)'
|
|
|
|
required: false
|
|
|
|
test:
|
|
|
|
description: 'Run tests (test)'
|
|
|
|
required: false
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-03-30 15:20:33 -07:00
|
|
|
runs-on: windows-latest
|
2023-03-30 15:02:57 -07:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2023-03-30 15:20:33 -07:00
|
|
|
- name: Install Meson, Ninja, and Clang with Chocolatey
|
2023-03-30 15:02:57 -07:00
|
|
|
shell: pwsh
|
|
|
|
run: |
|
|
|
|
$ErrorActionPreference = "Stop"
|
2023-03-30 15:20:33 -07:00
|
|
|
Set-ExecutionPolicy Bypass -Scope Process -Force
|
|
|
|
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
2023-03-30 15:28:06 -07:00
|
|
|
choco install -y python ninja llvm
|
|
|
|
python -m pip install meson
|
2023-03-30 15:02:57 -07:00
|
|
|
|
|
|
|
- name: Run PowerShell build script
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
CC: clang
|
|
|
|
CXX: clang++
|
|
|
|
BUILD_TYPE: ${{ github.event.inputs.type }}
|
|
|
|
RUN_TESTS: ${{ github.event.inputs.test }}
|
|
|
|
run: |
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
|
|
|
|
$type = $env:BUILD_TYPE
|
|
|
|
$test = $env:RUN_TESTS
|
|
|
|
|
|
|
|
$args = @()
|
|
|
|
if (-not [string]::IsNullOrEmpty($type)) { $args += $type }
|
|
|
|
if (-not [string]::IsNullOrEmpty($test)) { $args += $test }
|
|
|
|
|
|
|
|
& .\scripts\build.ps1 @args
|