Skip to content

Commit 6419b40

Browse files
committed
Add macOS test build workflow
1 parent 5a6cb54 commit 6419b40

1 file changed

Lines changed: 103 additions & 0 deletions

File tree

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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: Install build dependencies
53+
shell: bash
54+
run: |
55+
set -euo pipefail
56+
brew update
57+
brew install ldc pkg-config curl sqlite
58+
59+
- name: Configure Homebrew build environment
60+
shell: bash
61+
run: |
62+
set -euo pipefail
63+
BREW_PREFIX="$(brew --prefix)"
64+
{
65+
echo "PATH=$BREW_PREFIX/opt/ldc/bin:$BREW_PREFIX/opt/curl/bin:$BREW_PREFIX/bin:$PATH"
66+
echo "PKG_CONFIG_PATH=$BREW_PREFIX/opt/curl/lib/pkgconfig:$BREW_PREFIX/opt/sqlite/lib/pkgconfig:$BREW_PREFIX/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
67+
echo "CPPFLAGS=-I$BREW_PREFIX/opt/curl/include -I$BREW_PREFIX/opt/sqlite/include ${CPPFLAGS:-}"
68+
echo "LDFLAGS=-L$BREW_PREFIX/opt/curl/lib -L$BREW_PREFIX/opt/sqlite/lib ${LDFLAGS:-}"
69+
} >> "$GITHUB_ENV"
70+
71+
- name: Show toolchain versions
72+
shell: bash
73+
run: |
74+
set -euo pipefail
75+
uname -a
76+
ldc2 --version
77+
pkg-config --modversion libcurl
78+
pkg-config --modversion sqlite3
79+
80+
- name: Configure
81+
shell: bash
82+
run: |
83+
set -euo pipefail
84+
./configure
85+
86+
- name: Compile
87+
shell: bash
88+
run: |
89+
set -euo pipefail
90+
make clean
91+
make -j"$(sysctl -n hw.ncpu)"
92+
93+
- name: Install
94+
shell: bash
95+
run: |
96+
set -euo pipefail
97+
sudo make install
98+
99+
- name: Run version sanity check
100+
shell: bash
101+
run: |
102+
set -euo pipefail
103+
onedrive --version

0 commit comments

Comments
 (0)