-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (78 loc) · 2.59 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
name: Build and Run Automated Tests
on: [push, pull_request]
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install CMake
run: |
$url = 'https://github.com/Kitware/CMake/releases/download/v3.26.0/cmake-3.26.0-windows-x86_64.msi'
$output = 'cmake.msi'
Invoke-WebRequest -Uri $url -OutFile $output
Start-Process msiexec.exe -Wait -ArgumentList '/i', $output, '/quiet', '/norestart'
echo "C:\Program Files\CMake\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install vcpkg and SQLite3
run: |
git clone https://github.com/microsoft/vcpkg
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install sqlite3:x64-windows
- name: List installed vcpkg packages
run: .\vcpkg\vcpkg list
- name: Set up Visual Studio Environment
uses: ilammy/msvc-dev-cmd@v1
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake"
- name: Build
run: cmake --build build
- name: Test
run: bin\Debug\tests
- name: Clear CMake Cache
run: Remove-Item -Path build -Recurse -Force
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ libsqlite3-dev
- name: Configure CMake
run: cmake -S . -B build
- name: Build
run: cmake --build build
- name: Run Tests
run: |
cd bin
./tests
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
brew update
brew install cmake sqlite3
- name: Configure CMake
run: cmake -S . -B build
- name: Build
run: cmake --build build
- name: Run Tests
run: |
cd bin
./tests
linter:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install Clang-Format
run: choco install llvm
- name: Run Clang-Format Linter
run: |
clang-format --version
# Adjust the following command as per your project structure and linting rules
clang-format -i -style=file $(git ls-files | where { $_ -match '\.(cpp|h)$' })
git diff --exit-code || {
echo "Linter found unformatted code!"
exit 1
}