-
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 2 KB
/
cmake-multi-platform.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
name: C++ CI
on:
push:
branches:
- ak5k-patch-1
# tags:
# - '*'
env:
APPVEYOR: true
APPVEYOR_BUILD_NUMBER: ${{ github.run_number }}
APPVEYOR_REPO_COMMIT: ${{ github.sha }}
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# cpp_compiler: [g++, clang++]
# c_compiler: [gcc, clang]
build_type: [Release]
steps:
- uses: actions/checkout@v2
- name: Create Build Environment
# Some setup steps may vary depending on the operating system
shell: bash
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
sudo apt-get update
sudo apt-get install -y cmake
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
brew install cmake
fi
- name: Configure CMake
# Note the current configuration is for a basic C++ project. You'll need to update this for your specific needs.
run: cmake -B ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{ github.workspace }} --config ${{ matrix.build_type }}
- name: Test
working-directory: ${{ github.workspace }}
# Execute tests defined by the CMake configuration
run: ctest --build-config ${{ matrix.build_type }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: my-artifact
path: ${{ github.workspace }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false