@@ -3,6 +3,7 @@ name: Build & Test
33on :
44 push :
55 branches : [main, master]
6+ tags : ['v*']
67 pull_request :
78 branches : [main, master]
89
@@ -14,19 +15,24 @@ jobs:
1415 include :
1516 - os : macos-latest
1617 arch : arm64
17- name : macOS ARM64
18+ name : macos-arm64
1819 - os : macos-15-intel
1920 arch : x64
20- name : macOS x64
21+ name : macos- x64
2122 - os : ubuntu-24.04
2223 arch : x64
23- name : Linux x64
24+ name : linux- x64
2425 - os : ubuntu-24.04-arm
2526 arch : arm64
26- name : Linux ARM64
27+ name : linux-arm64
2728 - os : windows-latest
2829 arch : x64
29- name : Windows x64
30+ name : windows-x64
31+ # Android cross-compile on Linux x64
32+ - os : ubuntu-24.04
33+ arch : arm64
34+ name : android-arm64
35+ android : true
3036
3137 runs-on : ${{ matrix.os }}
3238 name : ${{ matrix.name }}
@@ -40,25 +46,29 @@ jobs:
4046 xmake-version : 3.0.7
4147
4248 - name : Setup pnpm
49+ if : ${{ !matrix.android }}
4350 uses : pnpm/action-setup@v4
4451 with :
4552 version : 10
4653
4754 - name : Setup Node.js
55+ if : ${{ !matrix.android }}
4856 uses : actions/setup-node@v4
4957 with :
5058 node-version : 22
5159
5260 - name : Install TS dependencies
61+ if : ${{ !matrix.android }}
5362 working-directory : src/core/typescript
5463 run : pnpm install
5564
5665 - name : Build TypeScript
66+ if : ${{ !matrix.android }}
5767 working-directory : src/core/typescript
5868 run : pnpm build
5969
60- - name : Install GCC 15 (Linux)
61- if : runner.os == 'Linux'
70+ - name : Install GCC 15 (Linux native )
71+ if : runner.os == 'Linux' && !matrix.android
6272 run : |
6373 sudo apt-get update
6474 sudo apt-get install -y software-properties-common
@@ -68,18 +78,54 @@ jobs:
6878 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 100
6979 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-15 100
7080
71- - name : Configure xmake
72- if : runner.os == 'Linux'
81+ - name : Setup Android NDK
82+ if : ${{ matrix.android }}
83+ uses : nttld/setup-ndk@v1
84+ id : setup-ndk
85+ with :
86+ ndk-version : r27c
87+
88+ - name : Configure xmake (Android)
89+ if : ${{ matrix.android }}
90+ run : |
91+ xmake f -p android --ndk=${{ steps.setup-ndk.outputs.ndk-path }} --ndk_sdkver=21 -a arm64-v8a -m releasedbg -v -y
92+
93+ - name : Configure xmake (Linux native)
94+ if : runner.os == 'Linux' && !matrix.android
7395 run : |
7496 xmake f -m releasedbg -v -y --toolchain=gcc
75-
76- - name : Configure xmake
97+
98+ - name : Configure xmake (non-Linux)
7799 if : runner.os != 'Linux'
78100 run : |
79101 xmake f -m releasedbg -v -y
80102
81- - name : Build
103+ - name : Build (Android - injectee only)
104+ if : ${{ matrix.android }}
105+ run : xmake build -y chromatic-injectee
106+
107+ - name : Build (native)
108+ if : ${{ !matrix.android }}
82109 run : xmake build -y
83110
84111 - name : Test
112+ if : ${{ !matrix.android }}
85113 run : xmake run chromatic-test
114+
115+ - name : Prepare artifacts
116+ shell : bash
117+ run : |
118+ mkdir -p artifacts
119+ if [ "${{ runner.os }}" = "Windows" ]; then
120+ find build -name "chromatic-injectee.dll" -exec cp {} artifacts/ \;
121+ elif [ "${{ runner.os }}" = "macOS" ]; then
122+ find build -name "libchromatic-injectee.dylib" -exec cp {} artifacts/ \;
123+ else
124+ find build -name "libchromatic-injectee.so" -exec cp {} artifacts/ \;
125+ fi
126+
127+ - name : Upload Artifact
128+ uses : actions/upload-artifact@v4
129+ with :
130+ name : chromatic-injectee-${{ matrix.name }}
131+ path : artifacts/*
0 commit comments