Skip to content

Commit 9a9c774

Browse files
committed
workflow: Add workflow
1 parent f2ff67f commit 9a9c774

1 file changed

Lines changed: 112 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Build ANGLE
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [ opened, reopened ]
9+
workflow_dispatch:
10+
11+
jobs:
12+
update-build-environment-cache:
13+
permissions:
14+
actions: write
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Restore environment from cache
18+
id: cached-environment-restore
19+
uses: actions/cache/restore@v4
20+
with:
21+
path: ./
22+
key: ios_and_android-build-environment
23+
- name: Verify cached environment is valid
24+
run: |
25+
if [ ! -d "depot_tools" ] ; then
26+
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
27+
fi
28+
export PATH="$PWD/depot_tools:$PATH"
29+
gclient config --spec 'solutions = [
30+
{
31+
"name": ".",
32+
"url": "https://chromium.googlesource.com/angle/angle.git",
33+
"deps_file": "DEPS",
34+
"managed": False,
35+
"custom_vars": {},
36+
},
37+
]
38+
target_os = ["ios", "android"]'
39+
gclient sync -Rf --no-history --with_branch_heads
40+
# Stupid workaround, see https://github.com/azu/github-actions-overwrite-cache-example and https://github.com/actions/cache/issues/342
41+
- name: Delete Previous Cache
42+
run: |
43+
gh cache delete "${{ steps.cached-environment-restore.outputs.cache-primary-key }}" --repo $GITHUB_REPOSITORY
44+
env:
45+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
- name: Save environment to cache
47+
uses: actions/cache/save@v4
48+
with:
49+
path: ./
50+
key: ios_and_android-build-environment
51+
52+
build:
53+
needs: update-build-environment-cache
54+
strategy:
55+
matrix:
56+
include:
57+
- os: android
58+
arch: arm64
59+
runs-on: ubuntu-24.04
60+
- os: android
61+
arch: arm
62+
runs-on: ubuntu-24.04
63+
- os: android
64+
arch: x86
65+
runs-on: ubuntu-24.04
66+
- os: android
67+
arch: x64
68+
runs-on: ubuntu-24.04
69+
- os: ios
70+
arch: arm64
71+
runs-on: macos-15
72+
runs-on: ${{ matrix.runs-on }}
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
- name: Restore environment from cache
77+
id: cached-environment-restore
78+
uses: actions/cache/restore@v4
79+
with:
80+
path: ./
81+
key: ios_and_android-build-environment
82+
- name: Fetch, verify, and setup build environment
83+
run: |
84+
export PATH="$PWD/depot_tools:$PATH"
85+
echo "$PWD/depot_tools" >> $GITHUB_PATH
86+
gclient config --spec 'solutions = [
87+
{
88+
"name": ".",
89+
"url": "https://chromium.googlesource.com/angle/angle.git",
90+
"deps_file": "DEPS",
91+
"managed": False,
92+
"custom_vars": {},
93+
},
94+
]
95+
target_os = ["${{ matrix.os }}"]'
96+
gclient sync -Rf --no-history --with_branch_heads
97+
- name: Build ANGLE
98+
run: |
99+
gn gen out/${{ matrix.os }}-${{ matrix.arch }}
100+
autoninja -C out/${{ matrix.os }}-${{ matrix.arch }}
101+
- name: Upload builds
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: ANGLE-${{ matrix.os }}-${{ matrix.arch }}
105+
path: out/${{ matrix.os }}-${{ matrix.arch }}
106+
- name: Upload shared library
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: ANGLE-${{ matrix.os }}-${{ matrix.arch }}.so
110+
path: |
111+
out/${{ matrix.os }}-${{ matrix.arch }}/lib*.so
112+
!out/${{ matrix.os }}-${{ matrix.arch }}/*.so.TOC

0 commit comments

Comments
 (0)