Skip to content

Commit 8bc862d

Browse files
committed
Add macOS test build workflow
1 parent 5a6cb54 commit 8bc862d

1 file changed

Lines changed: 110 additions & 0 deletions

File tree

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: macOS Test Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- feature/**
8+
paths:
9+
- 'src/**'
10+
- 'ci/**'
11+
- '.github/workflows/macos-testbuild.yaml'
12+
- 'configure'
13+
- 'Makefile.in'
14+
- 'DUB.json'
15+
- 'dub.json'
16+
pull_request:
17+
branches:
18+
- master
19+
paths:
20+
- 'src/**'
21+
- 'ci/**'
22+
- '.github/workflows/macos-testbuild.yaml'
23+
- 'configure'
24+
- 'Makefile.in'
25+
- 'DUB.json'
26+
- 'dub.json'
27+
workflow_dispatch:
28+
29+
permissions:
30+
contents: read
31+
32+
jobs:
33+
macos-build:
34+
name: macOS ${{ matrix.macos }} test build
35+
runs-on: ${{ matrix.macos }}
36+
timeout-minutes: 45
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
macos:
41+
- macos-14
42+
- macos-15
43+
44+
steps:
45+
- name: Checkout repository with full history and tags
46+
uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
fetch-tags: true
50+
submodules: recursive
51+
52+
- name: Fetch tags for version generation
53+
shell: bash
54+
run: |
55+
set -euo pipefail
56+
git fetch --force --tags origin 'refs/tags/*:refs/tags/*'
57+
git describe --tags
58+
59+
- name: Install build dependencies
60+
shell: bash
61+
run: |
62+
set -euo pipefail
63+
brew update
64+
brew install ldc pkg-config curl sqlite
65+
66+
- name: Configure Homebrew build environment
67+
shell: bash
68+
run: |
69+
set -euo pipefail
70+
BREW_PREFIX="$(brew --prefix)"
71+
{
72+
echo "PATH=$BREW_PREFIX/opt/ldc/bin:$BREW_PREFIX/opt/curl/bin:$BREW_PREFIX/bin:$PATH"
73+
echo "PKG_CONFIG_PATH=$BREW_PREFIX/opt/curl/lib/pkgconfig:$BREW_PREFIX/opt/sqlite/lib/pkgconfig:$BREW_PREFIX/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
74+
echo "CPPFLAGS=-I$BREW_PREFIX/opt/curl/include -I$BREW_PREFIX/opt/sqlite/include ${CPPFLAGS:-}"
75+
echo "LDFLAGS=-L$BREW_PREFIX/opt/curl/lib -L$BREW_PREFIX/opt/sqlite/lib ${LDFLAGS:-}"
76+
} >> "$GITHUB_ENV"
77+
78+
- name: Show toolchain versions
79+
shell: bash
80+
run: |
81+
set -euo pipefail
82+
uname -a
83+
ldc2 --version
84+
pkg-config --modversion libcurl
85+
pkg-config --modversion sqlite3
86+
87+
- name: Configure
88+
shell: bash
89+
run: |
90+
set -euo pipefail
91+
./configure
92+
93+
- name: Compile
94+
shell: bash
95+
run: |
96+
set -euo pipefail
97+
make clean
98+
make -j"$(sysctl -n hw.ncpu)"
99+
100+
- name: Install
101+
shell: bash
102+
run: |
103+
set -euo pipefail
104+
sudo make install
105+
106+
- name: Run version sanity check
107+
shell: bash
108+
run: |
109+
set -euo pipefail
110+
onedrive --version

0 commit comments

Comments
 (0)