-
Notifications
You must be signed in to change notification settings - Fork 393
131 lines (112 loc) · 3.64 KB
/
Copy pathbuild.yml
File metadata and controls
131 lines (112 loc) · 3.64 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build & Test
on:
push:
branches: [main, master]
tags: ['v*']
pull_request:
branches: [main, master]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
arch: arm64
name: macos-arm64
- os: macos-15-intel
arch: x64
name: macos-x64
- os: ubuntu-24.04
arch: x64
name: linux-x64
- os: ubuntu-24.04-arm
arch: arm64
name: linux-arm64
- os: windows-latest
arch: x64
name: windows-x64
# Android cross-compile on Linux x64
- os: ubuntu-24.04
arch: arm64
name: android-arm64
android: true
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
- name: Install xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: 3.0.8
- name: Setup pnpm
if: ${{ !matrix.android }}
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node.js
if: ${{ !matrix.android }}
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install TS dependencies
if: ${{ !matrix.android }}
working-directory: src/core/typescript
run: pnpm install
- name: Build TypeScript
if: ${{ !matrix.android }}
working-directory: src/core/typescript
run: pnpm build
- name: Install GCC 15 (Linux native)
if: runner.os == 'Linux' && !matrix.android
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-15 g++-15
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-15 100
- name: Setup Android NDK
if: ${{ matrix.android }}
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r27c
- name: Configure xmake (Android)
if: ${{ matrix.android }}
run: |
xmake f -p android --ndk=${{ steps.setup-ndk.outputs.ndk-path }} --ndk_sdkver=21 -a arm64-v8a -m releasedbg -v -y
- name: Configure xmake (Linux native)
if: runner.os == 'Linux' && !matrix.android
run: |
xmake f -m releasedbg -v -y --toolchain=gcc
- name: Configure xmake (non-Linux)
if: runner.os != 'Linux'
run: |
xmake f -m releasedbg -v -y
- name: Build (Android - injectee only)
if: ${{ matrix.android }}
run: xmake build -y chromatic-injectee
- name: Build (native)
if: ${{ !matrix.android }}
run: xmake build -y
- name: Test
if: ${{ !matrix.android }}
run: xmake run chromatic-test --no-signal-tests
- name: Prepare artifacts
shell: bash
run: |
mkdir -p artifacts
if [ "${{ runner.os }}" = "Windows" ]; then
find build -name "chromatic-injectee.dll" -exec cp {} artifacts/ \;
elif [ "${{ runner.os }}" = "macOS" ]; then
find build -name "libchromatic-injectee.dylib" -exec cp {} artifacts/ \;
else
find build -name "libchromatic-injectee.so" -exec cp {} artifacts/ \;
fi
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: chromatic-injectee-${{ matrix.name }}
path: artifacts/*