forked from koreader/koreader-base
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 2.37 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
name: macos
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [push, pull_request]
jobs:
build:
runs-on: macos-11
steps:
- name: XCode version
run: xcode-select -p
- name: Check out Git repository
uses: actions/checkout@v4
with:
clean: false
fetch-depth: 0
filter: tree:0
show-progress: false
- uses: actions/setup-python@v4
with:
# Note: Python 3.12 removal of `distutils` breaks GLib's build.
python-version: '3.11'
- name: Homebrew install dependencies
# Compared to the README, adds ccache for faster compilation times and removes sh5sum to prevent some conflict with coreutils, and gnu-getopt because we're not using kodev
run: brew install ccache nasm ragel binutils coreutils libtool autoconf automake cmake makedepend [email protected] luarocks gettext pkg-config wget gnu-getopt grep bison
- name: Build cache restore
id: build-cache-restore
uses: actions/cache/restore@v3
with:
path: /Users/runner/Library/Caches/ccache
key: ${{ runner.os }}-build-cache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-cache-${{ github.sha }}-
${{ runner.os }}-build-cache-
- name: Build cache post-restore
run: |
set -x
which ccache
ccache --version
ccache --zero-stats
ccache --max-size=256M
ccache --show-config
- name: Building in progress…
id: build
run: |
export MACOSX_DEPLOYMENT_TARGET=11;
export PATH="$(brew --prefix)/opt/gettext/bin:$(brew --prefix)/opt/gnu-getopt/bin:$(brew --prefix)/opt/bison/bin:$(brew --prefix)/opt/grep/libexec/gnubin:${PATH}";
make fetchthirdparty && make
- name: Build cache pre-save
if: always()
run: |
set -x
ccache --cleanup >/dev/null
ccache --show-stats --verbose
- name: Build cache save
uses: actions/cache/save@v3
if: always() && steps.build-cache-restore.outputs.cache-hit != 'true'
with:
path: /Users/runner/Library/Caches/ccache
key: ${{ steps.build-cache-restore.outputs.cache-primary-key }}${{ steps.build.outcome != 'success' && format('-{0}', github.run_attempt) || '' }}