-
Notifications
You must be signed in to change notification settings - Fork 11
147 lines (130 loc) · 8.13 KB
/
ci.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-and-test:
name: Build and Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
num-parse-method: boost
- os: ubuntu-latest
num-parse-method: FastFloat
- os: ubuntu-latest
num-parse-method: FromChars
- os: ubuntu-latest
num-parse-method: strtod
- os: macos-latest
num-parse-method: FastFloat
- os: windows-latest
num-parse-method: FromChars
# - os: windows-latest
# num-parse-method: strtod
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.25'
# For linux, we will perform developer checks, so we need boost
- name: Set up dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y build-essential libboost-all-dev gfortran zlib1g-dev
- name: Create build directory
run: mkdir build
- name: Configure CMake on Windows
if: runner.os == 'Windows'
run: cmake -S ${{ github.workspace }} -B build -DSpecUtils_BUILD_UNIT_TESTS=ON -DSpecUtils_BUILD_REGRESSION_TEST=ON -DSpecUtils_ENABLE_EQUALITY_CHECKS=ON -DPERFORM_DEVELOPER_CHECKS=OFF -DSpecUtils_ENABLE_D3_CHART=ON -DSpecUtils_D3_SUPPORT_FILE_STATIC=ON -DSpecUtils_ENABLE_URI_SPECTRA=OFF -DCMAKE_BUILD_TYPE=Release -DSpecUtils_FLT_PARSE_METHOD=${{ matrix.num-parse-method }} -DSpecUtils_FETCH_FAST_FLOAT=ON -DSpecUtils_C_BINDINGS=OFF -DCMAKE_INSTALL_PREFIX=install_prefix
# On linux we will perform developer checks and compile as debug to catch asserts
- name: Configure CMake on Linux
if: runner.os == 'Linux'
run: cmake -S ${{ github.workspace }} -B build -DSpecUtils_BUILD_UNIT_TESTS=ON -DSpecUtils_BUILD_REGRESSION_TEST=ON -DSpecUtils_ENABLE_EQUALITY_CHECKS=ON -DPERFORM_DEVELOPER_CHECKS=ON -DSpecUtils_ENABLE_D3_CHART=ON -DSpecUtils_D3_SUPPORT_FILE_STATIC=ON -DSpecUtils_ENABLE_URI_SPECTRA=OFF -DCMAKE_BUILD_TYPE=Release -DSpecUtils_FLT_PARSE_METHOD=${{ matrix.num-parse-method }} -DSpecUtils_FETCH_FAST_FLOAT=ON -DSpecUtils_C_BINDINGS=ON -DSpecUtils_FORTRAN_SWIG=ON -DCMAKE_INSTALL_PREFIX=install_prefix
- name: Configure CMake on macOS
if: runner.os == 'macOS'
run: cmake -S ${{ github.workspace }} -B build -DSpecUtils_BUILD_UNIT_TESTS=ON -DSpecUtils_BUILD_REGRESSION_TEST=ON -DSpecUtils_ENABLE_EQUALITY_CHECKS=ON -DPERFORM_DEVELOPER_CHECKS=OFF -DSpecUtils_ENABLE_D3_CHART=ON -DSpecUtils_D3_SUPPORT_FILE_STATIC=ON -DSpecUtils_ENABLE_URI_SPECTRA=ON -DCMAKE_BUILD_TYPE=Release -DSpecUtils_FLT_PARSE_METHOD=${{ matrix.num-parse-method }} -DSpecUtils_FETCH_FAST_FLOAT=ON -DSpecUtils_C_BINDINGS=ON -DCMAKE_INSTALL_PREFIX=install_prefix
- name: Build macOS and Windows
if: runner.os != 'Linux'
run: cmake --build build --config Release
- name: Build Linux
if: runner.os == 'Linux'
run: cmake --build build --config Release -j $(nproc)
- name: Run tests
run: ctest --rerun-failed --output-on-failure --test-dir build -C Release
- name: Package Lib
if: runner.os == 'Windows'
run: |
cmake -S ${{ github.workspace }} -B build_static_lib_shared_runtime -DSpecUtils_BUILD_UNIT_TESTS=OFF -DSpecUtils_BUILD_REGRESSION_TEST=OFF -DSpecUtils_ENABLE_EQUALITY_CHECKS=OFF -DPERFORM_DEVELOPER_CHECKS=OFF -DSpecUtils_ENABLE_D3_CHART=ON -DSpecUtils_D3_SUPPORT_FILE_STATIC=ON -DSpecUtils_ENABLE_URI_SPECTRA=OFF -DCMAKE_BUILD_TYPE=Release -DSpecUtils_FLT_PARSE_METHOD=${{ matrix.num-parse-method }} -DSpecUtils_FETCH_FAST_FLOAT=ON -DCMAKE_INSTALL_PREFIX=install_prefix_static_lib_shared_runtime -DSpecUtils_USE_MSVC_MultiThreadDLL=ON -DSpecUtils_SHARED_LIB=OFF
cmake --build build_static_lib_shared_runtime --config Release --target package
echo "Files present after package build_static_lib_shared_runtime"
ls
ls build_static_lib_shared_runtime
ls build_static_lib_shared_runtime/Release
ls build_static_lib_shared_runtime/x64/Release
#
cmake -S ${{ github.workspace }} -B build_shared_lib_shared_runtime -DSpecUtils_BUILD_UNIT_TESTS=OFF -DSpecUtils_BUILD_REGRESSION_TEST=OFF -DSpecUtils_ENABLE_EQUALITY_CHECKS=OFF -DPERFORM_DEVELOPER_CHECKS=OFF -DSpecUtils_ENABLE_D3_CHART=ON -DSpecUtils_D3_SUPPORT_FILE_STATIC=ON -DSpecUtils_ENABLE_URI_SPECTRA=OFF -DCMAKE_BUILD_TYPE=Release -DSpecUtils_FLT_PARSE_METHOD=${{ matrix.num-parse-method }} -DSpecUtils_FETCH_FAST_FLOAT=ON -DCMAKE_INSTALL_PREFIX=install_prefix_build_shared_lib_shared_runtime -DSpecUtils_USE_MSVC_MultiThreadDLL=ON -DSpecUtils_SHARED_LIB=ON
cmake --build build_shared_lib_shared_runtime --config Release --target package
echo "Files present after package build_shared_lib_shared_runtime"
ls
ls build_shared_lib_shared_runtime
ls build_shared_lib_shared_runtime/Release
ls build_shared_lib_shared_runtime/x64/Release
#
cmake -S ${{ github.workspace }} -B build_shared_lib_static_runtime -DSpecUtils_BUILD_UNIT_TESTS=OFF -DSpecUtils_BUILD_REGRESSION_TEST=OFF -DSpecUtils_ENABLE_EQUALITY_CHECKS=OFF -DPERFORM_DEVELOPER_CHECKS=OFF -DSpecUtils_ENABLE_D3_CHART=ON -DSpecUtils_D3_SUPPORT_FILE_STATIC=ON -DSpecUtils_ENABLE_URI_SPECTRA=OFF -DCMAKE_BUILD_TYPE=Release -DSpecUtils_FLT_PARSE_METHOD=${{ matrix.num-parse-method }} -DSpecUtils_FETCH_FAST_FLOAT=ON -DCMAKE_INSTALL_PREFIX=install_prefix_build_shared_lib_static_runtime -DSpecUtils_USE_MSVC_MultiThreadDLL=OFF -DSpecUtils_SHARED_LIB=ON
cmake --build build_shared_lib_static_runtime --config Release --target package
echo "Files present after package build_shared_lib_static_runtime"
ls
ls build_shared_lib_static_runtime
ls build_shared_lib_static_runtime/Release
ls build_shared_lib_static_runtime/x64/Release
#
cmake -S ${{ github.workspace }} -B build_static_lib_static_runtime -DSpecUtils_BUILD_UNIT_TESTS=OFF -DSpecUtils_BUILD_REGRESSION_TEST=OFF -DSpecUtils_ENABLE_EQUALITY_CHECKS=OFF -DPERFORM_DEVELOPER_CHECKS=OFF -DSpecUtils_ENABLE_D3_CHART=ON -DSpecUtils_D3_SUPPORT_FILE_STATIC=ON -DSpecUtils_ENABLE_URI_SPECTRA=OFF -DCMAKE_BUILD_TYPE=Release -DSpecUtils_FLT_PARSE_METHOD=${{ matrix.num-parse-method }} -DSpecUtils_FETCH_FAST_FLOAT=ON -DCMAKE_INSTALL_PREFIX=install_prefix_build_static_lib_static_runtime -DSpecUtils_USE_MSVC_MultiThreadDLL=OFF -DSpecUtils_SHARED_LIB=OFF
cmake --build build_static_lib_static_runtime --config Release --target package
echo "Files present after package build_static_lib_static_runtime"
ls
ls build_static_lib_static_runtime
ls build_static_lib_static_runtime/Release
ls build_static_lib_static_runtime/x64/Release
# Update the bleeding-edge tag to be current commit
- name: Run latest-tag
uses: EndBug/[email protected]
if: matrix.os == 'Windows'
with:
ref: bleeding-edge
description: Latest successful automated build
- name: Upload windows build to GitHub Artifact
uses: actions/upload-artifact@v4
if: runner.os == 'Windows'
with:
name: SpecUtils_${{ runner.os }}_latest
path: '.\build_*\*.zip'
- name: Create Release
uses: ncipollo/[email protected]
if: runner.os == 'Windows'
with:
artifacts: '.\build_*\*.zip'
draft: false
prerelease: true
body: "An automated, and untested build of the latest code pushed to the repository."
allowUpdates: true
generateReleaseNotes: false
name: "Bleeding Edge Build"
removeArtifacts: true
replacesArtifacts: true
tag: 'bleeding-edge'
commit: ${{ github.sha }}
makeLatest: true
# Delete all the zip files we created
- name: "Cleanup and finish"
if: runner.os == 'Windows'
run: |
Get-ChildItem '.\build_*\*.zip' | foreach { Remove-Item -Path $_.FullName }
echo "Job status is ${{ job.status }}."