-
Notifications
You must be signed in to change notification settings - Fork 299
99 lines (86 loc) · 3.32 KB
/
macos.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
name: MacOs build
on: [push]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
REPO_DIR : ${{github.workspace}}
BUILD_DIR: ${{github.workspace}}/bin/builddir
BOOST_PLATFORM_VERSION: "11"
BOOST_VERSION: "1.79.0"
BOOST_INSTALL_DIR: "${{github.workspace}}/bin"
permissions:
contents: read
jobs:
build:
runs-on: macos-11
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ${{env.REPO_DIR}}
- name: Install dependencies
run: |
brew install mysql-client
brew install openssl
echo "OPENSSL_ROOT_DIR=$(brew --prefix --installed openssl)" >> $GITHUB_ENV
mkdir -p ${{env.BOOST_INSTALL_DIR}}
- name: Cache Windows boost
uses: actions/cache@v2
id: cache-boost
with:
path: "${{env.BOOST_INSTALL_DIR}}/boost"
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/macos.yml') }}
- if: steps.cache-boost.outputs.cache-hit != 'true'
name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json
boost_version: ${{env.BOOST_VERSION}}
# OPTIONAL: Specify a platform version
platform_version: ${{env.BOOST_PLATFORM_VERSION}}
# OPTIONAL: Specify a custom install location
boost_install_dir: ${{env.BOOST_INSTALL_DIR}}
# OPTIONAL: Specify a toolset
toolset: clang
- name: Configure
env:
BOOST_ROOT: "${{env.BOOST_INSTALL_DIR}}/boost/boost"
run: cmake -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} -DBoost_ARCHITECTURE=-x64
- name: Build
env:
MAKEFLAGS: "-j8"
run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}}
notify:
permissions:
contents: none
name: Discord Notification
runs-on: ubuntu-20.04
needs: # make sure the notification is sent AFTER the jobs you want included have completed
- build
if: failure()
steps:
- name: Env
run: |
echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "GIT_SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Notify
uses: rjstone/[email protected]
with:
severity: error
username: ${{env.EXPENSION_NAME}}-core
description: |
**MacOS buid failed**
details: |
- **Branch:** ${{env.GIT_BRANCH}}
- **Pusher:** ${{github.event.pusher.name}}
- **Author:** ${{github.event.head_commit.author.name}}
- **Commit:** [${{github.repository}}/${{env.GIT_SHORT_SHA}}](${{github.server_url}}/${{ github.repository }}/commit/${{github.sha}})
- **Build log:** [actions/runs/${{github.run_id}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}})
footer: Next time ${{github.event.pusher.name}}!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
avatarUrl: https://github.githubassets.com/images/modules/logos_page/Octocat.png