Skip to content

Commit ecb3cee

Browse files
committed
ci/cd for macos
1 parent b1bf4d7 commit ecb3cee

File tree

5 files changed

+296
-0
lines changed

5 files changed

+296
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CD for Mogan Research on macOS
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
macosbuild:
11+
runs-on: macos-13
12+
timeout-minutes: 45
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 1
17+
- name: Install Qt
18+
uses: jurplel/install-qt-action@v3
19+
with:
20+
version: 6.5.3
21+
target: 'desktop'
22+
cache: 'true'
23+
- uses: xmake-io/github-action-setup-xmake@v1
24+
with:
25+
xmake-version: v2.8.7
26+
actions-cache-folder: '.xmake-cache'
27+
- name: xmake repo --update
28+
run: xmake repo --update
29+
- name: config
30+
run: xmake config -m release -vD --yes
31+
- name: build
32+
run: xmake build -vD --diagnosis research
33+
- name: install
34+
run: xmake install -vD research
35+
- name: Generate Installer
36+
run: |
37+
xmake install -vD research_packager
38+
- name: Upload
39+
uses: actions/upload-artifact@v4
40+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
41+
with:
42+
path: build/MoganResearch-*.dmg
43+
- name: Release
44+
uses: softprops/action-gh-release@v1
45+
if: startsWith(github.ref, 'refs/tags/')
46+
with:
47+
prerelease: true
48+
files: build/MoganResearch-*.dmg
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CD for Mogan Research on macOS arm64
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
macosbuild:
11+
strategy:
12+
matrix:
13+
os: [macos-13]
14+
arch: [arm64]
15+
runs-on: ${{ matrix.os }}
16+
timeout-minutes: 45
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 1
21+
- name: Install Qt
22+
uses: jurplel/install-qt-action@v3
23+
with:
24+
version: 6.5.3
25+
target: 'desktop'
26+
cache: 'true'
27+
- uses: xmake-io/github-action-setup-xmake@v1
28+
with:
29+
xmake-version: v2.8.7
30+
actions-cache-folder: '.xmake-cache'
31+
- name: xmake repo --update
32+
run: xmake repo --update
33+
- name: config
34+
run: xmake config -m release -a ${{ matrix.arch }} -vD --yes
35+
- name: build
36+
run: xmake build -vD --diagnosis research
37+
- name: install
38+
run: xmake install -vD research
39+
- name: Generate Installer
40+
run: |
41+
xmake install -vD research_packager
42+
- name: Upload
43+
uses: actions/upload-artifact@v4
44+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
45+
with:
46+
path: build/MoganResearch-*.dmg
47+
- name: Release
48+
uses: softprops/action-gh-release@v1
49+
if: startsWith(github.ref, 'refs/tags/')
50+
with:
51+
prerelease: true
52+
files: build/MoganResearch-*.dmg
53+
54+
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Build and Test on macOS arm64
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'src/**'
8+
- '!src/Plugins/Windows/**'
9+
- 'tests/**'
10+
- 'xmake.lua'
11+
- 'xmake/packages.lua'
12+
- 'xmake/research.lua'
13+
- 'xmake/packages/**'
14+
- 'xmake-requires.lock'
15+
- '.github/workflows/ci-macos-arm64.yml'
16+
pull_request:
17+
branches: [ main ]
18+
paths:
19+
- 'src/**'
20+
- '!src/Plugins/Windows/**'
21+
- 'tests/**'
22+
- 'xmake.lua'
23+
- 'xmake/packages.lua'
24+
- 'xmake/research.lua'
25+
- 'xmake/packages/**'
26+
- 'xmake-requires.lock'
27+
- '.github/workflows/ci-macos-arm64.yml'
28+
29+
jobs:
30+
macosbuild:
31+
strategy:
32+
matrix:
33+
os: [macos-13]
34+
arch: [arm64]
35+
runs-on: ${{ matrix.os }}
36+
timeout-minutes: 45
37+
if: always()
38+
steps:
39+
- uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 1
42+
- name: cache xmake
43+
uses: actions/cache@v4
44+
with:
45+
path: |
46+
${{github.workspace}}/build/.build_cache
47+
/Users/runner/.xmake
48+
key: xmake-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('xmake-requires.lock') }}
49+
- name: Install Qt
50+
uses: jurplel/install-qt-action@v3
51+
with:
52+
version: 6.5.3
53+
target: 'desktop'
54+
cache: 'true'
55+
56+
- name: set XMAKE_GLOBALDIR
57+
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV
58+
59+
- uses: xmake-io/github-action-setup-xmake@v1
60+
with:
61+
xmake-version: v2.8.7
62+
actions-cache-folder: '.xmake-cache'
63+
64+
- name: xmake repo --update
65+
run: xmake repo --update
66+
67+
- name: cache packages from xrepo
68+
uses: actions/cache@v3
69+
with:
70+
path: |
71+
${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
72+
key: xrepo-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('xmake-requires.lock') }}
73+
74+
- name: cache xmake
75+
uses: actions/cache@v3
76+
with:
77+
path: |
78+
${{ runner.workspace }}/build/.build_cache
79+
key: xmake-build-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('xmake-requires.lock') }}
80+
81+
- name: config
82+
run: xmake config --policies=build.ccache -o ${{ runner.workspace }}/build -m releasedbg -a ${{ matrix.arch }} --yes
83+
- name: build
84+
run: xmake build --yes -vD research && xmake build --yes -vD --group=tests
85+
- name: C++ tests
86+
run: xmake run --yes --verbose --diagnosis --group=tests
87+
env:
88+
QT_QPA_PLATFORM: offscreen
89+
- name: Scheme tests
90+
run: xmake run --yes -vD --group=scheme_tests
91+
- name: integration test
92+
run: xmake run --yes -vD --group=integration_tests
93+
env:
94+
QT_QPA_PLATFORM: offscreen
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Build and Test on macOS
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'src/**'
8+
- '!src/Plugins/Windows/**'
9+
- 'TeXmacs/plugins/goldfish/src/*'
10+
- 'tests/**'
11+
- 'xmake.lua'
12+
- 'xmake/packages.lua'
13+
- 'xmake/research.lua'
14+
- 'xmake/packages/**'
15+
- 'xmake-requires.lock'
16+
- '.github/workflows/ci-xmake-macos.yml'
17+
pull_request:
18+
branches: [ main ]
19+
paths:
20+
- 'src/**'
21+
- '!src/Plugins/Windows/**'
22+
- 'TeXmacs/plugins/goldfish/src/*'
23+
- 'tests/**'
24+
- 'xmake.lua'
25+
- 'xmake/packages.lua'
26+
- 'xmake/research.lua'
27+
- 'xmake/packages/**'
28+
- 'xmake-requires.lock'
29+
- '.github/workflows/ci-xmake-macos.yml'
30+
31+
jobs:
32+
macosbuild:
33+
strategy:
34+
matrix:
35+
os: [macos-13]
36+
arch: [x86_64]
37+
runs-on: macos-13
38+
timeout-minutes: 45
39+
if: always()
40+
steps:
41+
- uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 1
44+
- name: cache xmake
45+
uses: actions/cache@v4
46+
with:
47+
path: |
48+
${{github.workspace}}/build/.build_cache
49+
/Users/runner/.xmake
50+
key: xmake-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('xmake-requires.lock') }}
51+
- name: Install Qt
52+
uses: jurplel/install-qt-action@v3
53+
with:
54+
version: 6.5.3
55+
target: 'desktop'
56+
cache: 'true'
57+
58+
- name: set XMAKE_GLOBALDIR
59+
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV
60+
61+
- uses: xmake-io/github-action-setup-xmake@v1
62+
with:
63+
xmake-version: v2.8.7
64+
actions-cache-folder: '.xmake-cache'
65+
66+
- name: xmake repo --update
67+
run: xmake repo --update
68+
69+
- name: cache packages from xrepo
70+
uses: actions/cache@v3
71+
with:
72+
path: |
73+
${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
74+
key: xrepo-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('xmake-requires.lock') }}
75+
76+
- name: cache xmake
77+
uses: actions/cache@v3
78+
with:
79+
path: |
80+
${{ runner.workspace }}/build/.build_cache
81+
key: xmake-build-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('xmake-requires.lock') }}
82+
83+
- name: config
84+
run: xmake config --policies=build.ccache -o ${{ runner.workspace }}/build -m releasedbg --yes
85+
- name: build
86+
run: xmake build --yes -vD research && xmake build --yes -vD --group=tests
87+
- name: C++ tests
88+
run: xmake run --yes --verbose --diagnosis --group=tests
89+
env:
90+
QT_QPA_PLATFORM: offscreen
91+
- name: Scheme tests
92+
run: xmake run --yes -vD --group=scheme_tests
93+
- name: integration test
94+
run: xmake run --yes -vD --group=integration_tests
95+
env:
96+
QT_QPA_PLATFORM: offscreen

devel/200_6.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# 200_6 Github Action支持macOS的构建和测试
2+
## 2025/06/29 CI/CD for MacOS
3+
### What
4+
添加了MacOS平台的Github CI/CD流水线

0 commit comments

Comments
 (0)