-
-
Notifications
You must be signed in to change notification settings - Fork 8
107 lines (105 loc) · 3.48 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
name: Pareto
on:
push:
paths-ignore:
- '**.md'
- 'README.md'
- '.github/**'
- '!.github/workflows/build.yml'
- 'documentation/**'
- '.clang-format'
- '.gitignore'
- 'LICENSE'
pull_request:
paths-ignore:
- '**.md'
- 'README.md'
- '.github/**'
- '!.github/workflows/build.yml'
- 'documentation/**'
- '.clang-format'
- '.gitignore'
- 'LICENSE'
jobs:
Build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows/Static/X64/Release",
os: windows-2019,
config: Release,
args: -G "Visual Studio 16 2019" -A x64 -DCMAKE_CXX_FLAGS="/O2",
get_core_cmd: "WMIC CPU Get DeviceID,NumberOfCores,NumberOfLogicalProcessors",
sudocmd: "",
artifact_name: "Windows",
cores: 2,
}
- {
name: "Linux/Static/X64/Release",
os: ubuntu-20.04,
config: Release,
args: "-DCMAKE_C_COMPILER=/usr/bin/gcc-8 -DCMAKE_CXX_COMPILER=/usr/bin/g++-8 -DCMAKE_CXX_FLAGS=\"-O2\"",
get_core_cmd: "lscpu",
sudocmd: "sudo",
artifact_name: "Linux",
cores: 2,
}
- {
name: "MacOSX/Static/X64/Release",
os: macos-10.15,
config: Release,
args: "-DCMAKE_CXX_FLAGS=\"-O2\"",
get_core_cmd: "system_profiler SPHardwareDataType",
sudocmd: "sudo",
artifact_name: "MacOSX",
cores: 4,
}
steps:
- uses: actions/checkout@v2
- name: Create Work Dir
run: mkdir build
- name: Get core number
run: ${{ matrix.config.get_core_cmd }}
continue-on-error: true
- name: Configure for pull_request
if: github.event_name == 'pull_request'
working-directory: ./build
run: |
cmake .. ${{ matrix.config.args }} -DCMAKE_BUILD_TYPE=${{ matrix.config.config }} -DBUILD_LONG_TESTS=OFF -DBUILD_BENCHMARKS=OFF
- name: Configure for push
if: github.event_name == 'push'
working-directory: ./build
run: |
cmake .. ${{ matrix.config.args }} -DCMAKE_BUILD_TYPE=${{ matrix.config.config }} -DBUILD_LONG_TESTS=OFF -DBUILD_BENCHMARKS=OFF
- name: Build
working-directory: ./build
run: cmake --build . -j ${{ matrix.config.cores }} --config ${{ matrix.config.config }}
- name: Archive Python Binding
uses: actions/upload-artifact@v2
with:
name: Python Binary ${{ matrix.config.artifact_name }}
path: |
build/pybindings/pareto.cp*-*.*
build/pybindings/Release/pareto.cp*-*.*
- name: Test
working-directory: ./build
run: ctest -j ${{ matrix.config.cores }} -C Release --verbose
- name: Install
working-directory: ./build
run: ${{ matrix.config.sudocmd }} cmake --install .
- name: Create packages
working-directory: ./build
run: ${{ matrix.config.sudocmd }} cpack
- name: Archive Installer Packages
uses: actions/upload-artifact@v2
with:
name: Binary Packages ${{ matrix.config.artifact_name }}
path: build/pareto-1.?.?-*.*
- name: Archive Installer Packages as is
uses: kittaakos/upload-artifact-as-is@v0
with:
path: build/pareto-1.?.?-*.*