forked from TAPZCREW/StormKit
-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (128 loc) · 4.56 KB
/
macOS.yml
File metadata and controls
149 lines (128 loc) · 4.56 KB
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
148
149
---
name: macOS
on:
pull_request:
branches: [develop]
paths-ignore:
- .github/workflows/Linux.yml
- .github/workflows/Windows.yml
- .github/workflows/iOS.yml
- .github/workflows/Android.yml
- .github/workflows/AutoMerger.yml
- .gitignore
- LICENSE
- README.md
push:
branches: [main, develop]
paths-ignore:
- .github/workflows/Linux.yml
- .github/workflows/Windows.yml
- .github/workflows/iOS.yml
- .github/workflows/Android.yml
- .github/workflows/AutoMerger.yml
- .gitignore
- LICENSE
- README.md
jobs:
build:
name: ${{ matrix.compiler }} ${{ matrix.arch }} (${{ matrix.kind }}/${{ matrix.mode }})
strategy:
fail-fast: false
matrix:
os: [macOS-15]
compiler: [LLVM-libc++]
arch: [arm64]
kind: [static, shared]
mode: [release, debug]
runs-on: ${{ matrix.os }}${{ (matrix.arch == 'x64') && '-large' || '' }}
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
concurrency:
group:
${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.kind
}}-${{ matrix.mode }}
steps:
- name: Install build tools
uses: tecolicom/actions-use-homebrew-tools@v1
with:
tools: llvm ninja meson cmake mold nasm pkgconf
verbose: true
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set XMake env
run: |
echo "XMAKE_ROOTDIR=${{ github.workspace }}/.xmake-cache" >> $GITHUB_ENV
echo "XMAKE_PKG_INSTALLDIR=${{ github.workspace }}/.xmake-packages" >> $GITHUB_ENV
echo "${{ github.workspace }}/.xmake-cache" >> $GITHUB_PATH
- name: Generate XMake cachekey
id: xmake_cachekey
run: echo "key=$(date +'%W')" >> $GITHUB_OUTPUT
shell: bash
- name: Restore cached XMake
id: restore-xmakecache
uses: actions/cache/restore@v4
with:
path: ${{ env.XMAKE_ROOTDIR }}
key: ${{ matrix.os }}-${{ matrix.arch }}-W${{ steps.xmake_cachekey.outputs.key }}
- name: Setup XMake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: Arthapz/xmake#branch@dev2
actions-cache-folder: .xmake-cache
- name: Cache XMake
if: ${{ !steps.restore-xmakecache.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: ${{ env.XMAKE_ROOTDIR }}
key: ${{ steps.restore-xmakecache.outputs.cache-primary-key }}
- name: Update XMake repository
run: xmake repo --update
- name: Generate packages cachekey
id: packages_cachekey
run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT
shell: bash
- name: Restore cached packages
id: restore-packagescache
uses: actions/cache/restore@v4
with:
path: ${{ env.XMAKE_PKG_INSTALLDIR }}
key: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.packages_cachekey.outputs.hash }}
- name: Configure & Install dependencies
id: configure
run: |
xmake f -vD \
--yes \
-m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} \
-k ${{ matrix.kind }} \
--examples=y \
--tests=y \
--mold=n \
--on_ci=y \
--sanitizers=n \
--toolchain=llvm \
--sdk="$(brew --prefix llvm)" \
--sc="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend" \
--runtimes="c++_shared"
- name: Cache packages
if: ${{ !steps.restore-packagescache.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: ${{ env.XMAKE_PKG_INSTALLDIR }}
key: ${{ steps.restore-packagescache.outputs.cache-primary-key }}
- name: Build
id: build
run: |
xmake b -v
- name: Run unit tests
id: tests
run: xmake test -v
- name: Installation
id: install
run: xmake install -v --installdir="${{ github.workspace }}/output"
- name: Upload artifacts
id: upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.kind }}-${{ matrix.mode }}
path: ${{ github.workspace }}/output