-
Notifications
You must be signed in to change notification settings - Fork 64
82 lines (66 loc) · 2.52 KB
/
gn.yml
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
# Workflow to build Dawn using GN
name: GN
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
gn_args: ['is_debug=true is_component_build=true is_clang=true']
steps:
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "gclient-cache-dir=${{ github.workspace }}/.gclient_cache" >> "$GITHUB_OUTPUT"
- name: Install Ubuntu build dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install libgl-dev libx11-xcb-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev
- name: Install Depot Tools
uses: newkdev/[email protected]
- uses: actions/checkout@v3
- name: Set up checkout
run: |
cp ./scripts/standalone.gclient .gclient
mkdir -p ${{ steps.strings.outputs.gclient-cache-dir }}
- name: gclient restore cache
id: gclient-restore
uses: actions/cache/restore@v3
with:
path: ${{ steps.strings.outputs.gclient-cache-dir }}
key: ${{ runner.os }}-${{ hashFiles('DEPS') }}
restore-keys: ${{ runner.os }}-
- name: gclient sync --no-history --shallow
run: gclient sync --no-history --shallow
env:
GIT_CACHE_PATH: ${{ steps.strings.outputs.gclient-cache-dir }}
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
- name: gclient save cache
id: gclient-save
uses: actions/cache/save@v3
with:
path: ${{ steps.strings.outputs.gclient-cache-dir }}
key: ${{ steps.gclient-restore.outputs.cache-primary-key }}
- name: Set up sccache
uses: mozilla-actions/[email protected]
- name: Generate build files
run: gn gen out/build --args='cc_wrapper=\"sccache\" ${{ matrix.gn_args }}'
env:
SCCACHE_GHA_ENABLED: "true"
- name: Build
run: autoninja -C out/build
env:
SCCACHE_GHA_ENABLED: "true"