This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
122 lines (107 loc) · 3.33 KB
/
build.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
110
111
112
113
114
115
116
117
118
119
120
121
122
name: build
on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- '.github/workflows/build.yml'
- '**/CMakeLists.txt'
- 'CMakeLists.txt'
- '**.cmake'
- '**.cpp'
- '**.cxx'
- '**.cc'
- '**.c'
- '**.hpp'
- '**.hh'
- '**.h'
push:
paths:
- '.github/workflows/build.yml'
- '**/CMakeLists.txt'
- 'CMakeLists.txt'
- '**.cmake'
- '**.cpp'
- '**.cxx'
- '**.cc'
- '**.c'
- '**.hpp'
- '**.hh'
- '**.h'
jobs:
formatting-check:
permissions:
contents: write
name: Formatting check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test formatting
uses: DoozyX/clang-format-lint-action@v0.17
with:
source: ./
extensions: h,hpp,cpp,c,cc
clangFormatVersion: 17
inplace: true
- name: Generate patch file
run: |
git diff > formatting.patch
find *.patch -type f -size 0 -delete
- name: Upload patch
uses: actions/upload-artifact@v4
with:
name: code-format
path: formatting.patch
- name: Error if fixed
run: |
if rm formatting.patch; then
echo "# Looks like you messed something up!" >> $GITHUB_STEP_SUMMARY
echo "1. Download the \`code-format\` artifact above" >> $GITHUB_STEP_SUMMARY
echo "2. Unpack the patch file" >> $GITHUB_STEP_SUMMARY
echo "3. Use \`git apply formatting.patch\` command to apply it to your repo" >> $GITHUB_STEP_SUMMARY
echo "4. Push the applied changes to your Pull Request" >> $GITHUB_STEP_SUMMARY
exit 1
fi
build:
needs: formatting-check
name: Emulator
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86_64
- name: Prepare Vulkan SDK
uses: humbletim/install-vulkan-sdk@c2aa128094d42ba02959a660f03e0a4e012192f9
with:
version: 1.3.275.0
cache: true
- name: Configure
run: |
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';'
echo "::add-matcher::tools/matchers/cmake.json"
cmake.exe -S. -B_build/_Release -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=_build/_Install -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DTEST_BENCH=ON -DISACTION=1
- name: Build
run: |
echo "::add-matcher::tools/matchers/cmake.json"
echo "::add-matcher::tools/matchers/compilers.json"
cmake --build _build/_Release -j4
- name: Install
run: |
echo "::add-matcher::tools/matchers/cmake.json"
cmake.exe --install _build/_Release
- name: Run some tests
shell: bash
run: echo "`node misc/testRunner`" >> $GITHUB_STEP_SUMMARY
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: psOff-emu
path: |
_build/_Install/*
!_build/_Install/vulkan-1.dll
!_build/_Install/*_test.exe