-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (87 loc) · 2.88 KB
/
msvc.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
name: MSVC
on: [push, pull_request]
env:
CTEST_OUTPUT_ON_FAILURE: 1
CRADLE_THINKNODE_API_TOKEN: ${{ secrets.CRADLE_THINKNODE_API_TOKEN }}
CRADLE_THINKNODE_DOCKER_AUTH: ${{ secrets.CRADLE_THINKNODE_DOCKER_AUTH }}
jobs:
preprocess:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# TODO: The preprocessing job shouldn't require vcpkg.
- uses: friendlyanon/setup-vcpkg@v1
with:
committish: 7ba0ba7334c3346e7eee1e049ba85da193a8d821
- name: Install
run: |
sudo apt install lcov ocaml-nox
sudo pip3 install virtualenv
- name: Preprocess
run: |
export CC=`which gcc-10`
export CXX=`which g++-10`
${CXX} --version
scripts/set-up-python.sh --python=python3
source .venv/bin/activate
cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug \
-D"CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \
.
cmake --build build --target preprocessing -j4
- name: Upload preprocessed headers as build artifact
uses: actions/upload-artifact@v4
with:
name: preprocessed
path: build/generated
- name: Deploy preprocessed headers to preprocessor-output repo
uses: JamesIves/[email protected]
with:
repository-name: open-cradle/preprocessor-output
branch: output
target-folder: generated
tag: output-${{ github.sha }}
token: ${{ secrets.CRADLE_PREPROCESSOR_OUTPUT_TOKEN }}
folder: build/generated
single-commit: true
VS2019:
runs-on: windows-2019
needs: preprocess
strategy:
matrix:
config: [Debug, Release]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: friendlyanon/setup-vcpkg@v1
with:
committish: 7ba0ba7334c3346e7eee1e049ba85da193a8d821
- name: Download preprocessed headers
uses: actions/download-artifact@v4
with:
name: preprocessed
path: preprocessed
- name: Set Up Python
run: |
pip install pyyaml
- name: Configure
run: >
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.config}}
-D"CMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
-DCRADLE_PREPROCESSOR_USAGE=External
-DCRADLE_EXTERNALLY_PREPROCESSED_DIRECTORY=preprocessed
-DCRADLE_LOCAL_DOCKER_TESTING=OFF
- name: Build
run: |
cmake --build build --config ${{matrix.config}} -j4
Get-ChildItem -Recurse build
- name: Test
run: |
python python/generate_config.py $Env:CRADLE_THINKNODE_API_TOKEN
cmake --build build --config ${{matrix.config}} --target all_unit_tests -j4
- name: Benchmarks
if: ${{ matrix.config == 'Release' }}
run: |
cmake --build build --config Release --target benchmark_tests