-
Notifications
You must be signed in to change notification settings - Fork 3
107 lines (86 loc) · 3.87 KB
/
build.yaml
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: autobuild
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
workflow_dispatch:
jobs:
windows-build:
name: Windows build
runs-on: windows-2019
env:
BUILD_DIR: '${{ github.workspace }}\build'
CMAKE_BUILD_PARALLEL_LEVEL: 2
CGAL_VERSION: 'v5.2'
CGAL_ARCHIVE_PREFIX: 'CGAL-5.2'
VCPKG_DEFAULT_BINARY_CACHE: '${{ github.workspace }}\bin-cache'
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: '0'
- name: Create vcpkg binary cache
run: New-Item -ItemType Directory ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@v6
with:
setupOnly: true
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }}
vcpkgTriplet: ${{ matrix.triplet }}
additionalCachedPaths: ${{ github.workspace }}/vcpkg_installed;${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
- name: Download binary CGAL ${{ env.CGAL_VERSION }}
run: |
(New-Object System.Net.WebClient).DownloadFile("https://github.com/CGAL/cgal/releases/download/${{ env.CGAL_VERSION }}/${{ env.CGAL_ARCHIVE_PREFIX }}-library.zip", "${{ env.CGAL_ARCHIVE_PREFIX }}-library.zip")
Expand-Archive ./${{ env.CGAL_ARCHIVE_PREFIX }}-library.zip -DestinationPath ..
ls ../${{ env.CGAL_ARCHIVE_PREFIX }}/lib/cmake/CGAL
- name: Download GMP and MPFR for ${{ env.CGAL_VERSION }}
run: |
(New-Object System.Net.WebClient).DownloadFile("https://github.com/CGAL/cgal/releases/download/${{ env.CGAL_VERSION }}/${{ env.CGAL_ARCHIVE_PREFIX }}-win64-auxiliary-libraries-gmp-mpfr.zip", "${{ env.CGAL_ARCHIVE_PREFIX }}-win64-auxiliary-libraries-gmp-mpfr.zip")
Expand-Archive ./${{ env.CGAL_ARCHIVE_PREFIX }}-win64-auxiliary-libraries-gmp-mpfr.zip -DestinationPath ..
ls "${{ github.workspace }}/../auxiliary"
- name: Install dependencies
run: |
./vcpkg/vcpkg.exe install --triplet x64-windows --clean-after-build
- name: Configure project
run: |
$GMPMPFR_LIB_DIR = "${{ github.workspace }}/../auxiliary/gmp"
$env:GMP_DIR = $GMPMPFR_LIB_DIR
$env:MPFR_DIR = $GMPMPFR_LIB_DIR
cmake --preset windows-vc16 `
-DCGAL_DIR:PATH="${{ github.workspace }}/../${{ env.CGAL_ARCHIVE_PREFIX }}/lib/cmake/CGAL"
- name: Build project
run: cmake --build ${{ env.BUILD_DIR }}
linux-build:
name: Linux build
runs-on: ubuntu-20.04
env:
BUILD_DIR: '${{ github.workspace }}/build'
CMAKE_BUILD_PARALLEL_LEVEL: 2
VCPKG_DEFAULT_BINARY_CACHE: '${{ github.workspace }}/bin-cache'
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: '0'
- name: Create vcpkg binary cache
run: mkdir ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
- name: Install OpenGL and CGAL
run: |
sudo apt update
sudo apt install -y freeglut3-dev libxt-dev libcgal-dev ninja-build libgmp-dev libmpfr-dev
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@v6
with:
setupOnly: true
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }}
vcpkgTriplet: ${{ matrix.triplet }}
additionalCachedPaths: ${{ github.workspace }}/vcpkg_installed;${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
- name: Install dependencies
run: ./vcpkg/vcpkg install --triplet x64-linux --clean-after-build
- name: Configure project
run: cmake --preset linux-ninja
- name: Build project
run: cmake --build ${{ env.BUILD_DIR }}