-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (91 loc) · 2.69 KB
/
Windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Windows
on:
push:
paths:
# Workflow file itself
- '.github/workflows/Windows.yml'
# C++ files
- '**.cpp'
- '**.hpp'
# CMake files
- '**.cmake'
- '**.txt'
# Script files
- '**.sh'
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- main
- develop
release:
types: [published]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Build:
runs-on: windows-2022
# Default windows to use bash
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
cfg:
- { compiler: cl }
#- { compiler: g++ }
#- { compiler: clang++ }
#- { compiler: clang++, sanitizer: "ubsan" }
build_type:
- "Debug"
- "Release"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- name: Setup Environment
run: external/Phi/scripts/ci/SetupEnvironment.sh
- name: Install
shell: powershell
run: |
# Install scoop
iwr -useb get.scoop.sh -outfile 'install.ps1'
.\install.ps1 -RunAsAdmin
# Install required compilers
if ("${{ matrix.cfg.compiler }}".StartsWith("clang")) {
# Clang
scoop install llvm --global
echo "CXX=${{ matrix.cfg.compiler }}" >> $GITHUB_ENV
echo "C:\ProgramData\scoop\apps\llvm\current\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
}
elseif ("${{ matrix.cfg.compiler }}" -eq "g++") {
# GCC
scoop install gcc --global
echo "CXX=${{ matrix.cfg.compiler }}" >> $GITHUB_ENV
echo "C:\ProgramData\scoop\apps\gcc\current\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
}
scoop install ninja --global
pip install jinja2
- name: Setup msvc dev
if: matrix.cfg.compiler == 'cl'
uses: ilammy/msvc-dev-cmd@v1
- name: Configure build directory
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE:STRING=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS:STRING="-DDLXEMU_VERIFY_UNDO_REDO -DDLXEMU_VERIFY_COLUMN" ..
- name: Build
working-directory: ./build
run: cmake --build . --config ${{ matrix.build_type }}
- name: Run tests
working-directory: ./build
run: ctest . -C ${{ matrix.build_type }}