Merge pull request #3 from Ed94/build_workflow

Create main.yml
This commit is contained in:
Edward R. Gonzalez 2023-03-30 18:04:00 -04:00 committed by GitHub
commit 2176314adf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

51
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,51 @@
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:
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Install Meson, Ninja, and Clang with Scoop
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
scoop install meson ninja llvm
- 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