-
Notifications
You must be signed in to change notification settings - Fork 127
163 lines (145 loc) · 5.46 KB
/
firefox.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Firefox
on:
push:
branches: ["main"]
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"]
pull_request:
branches: ["main"]
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
firefox:
name: Build Firefox
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14, windows-latest]
type: [debug, release]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
MOZBUILD_STATE_PATH: ${{ github.workspace }}/mozbuild
CARGO_HOME: ${{ github.workspace }}/cargo
FIREFOX: Firefox
steps:
# We need to check out Neqo first, because the maximize-build-space action
# is vendored in.
- name: Check out Neqo
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Maximize build space
if: runner.os == 'Linux'
uses: ./.github/actions/maximize-build-space
with:
root-reserve-mb: 4096
temp-reserve-mb: 4096
swap-size-mb: 8192
remove-dotnet: true
remove-android: true
remove-haskell: true
remove-docker-images: true
# The previous step blew it away, so we need to check it out again.
- name: Check out Neqo again
if: runner.os == 'Linux'
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Check out Firefox
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
repository: mozilla/gecko-dev
path: mozilla-unified
# - name: Use sccache
# uses: mozilla-actions/sccache-action@2e7f9ec7921547d4b46598398ca573513895d0bd # v0.0.4
# - name: Enable sscache
# run: echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
- name: Install deps (Windows)
if: runner.os == 'Windows'
run: choco install -y mozillabuild
- name: Bootstrap Firefox
run: |
cd mozilla-unified
{
echo "mk_add_options MOZ_OBJDIR=../$FIREFOX"
echo "ac_add_options --with-ccache=sccache"
echo "ac_add_options --enable-application=browser"
# Work around https://bugzilla.mozilla.org/show_bug.cgi?id=1894031
if [ "${{ runner.os }}" != "Windows" ] || [ "${{ matrix.type}}" != "debug" ]; then
echo "ac_add_options --disable-tests"
fi
echo "ac_add_options --enable-${{ matrix.type }}"
} >> mozconfig
./mach bootstrap --application-choice browser
- name: Plumb in Neqo
run: |
# Get qlog version used by neqo
cargo generate-lockfile
QLOG_VERSION=$(cargo pkgid qlog | cut -d@ -f2)
rm Cargo.lock
cd mozilla-unified
{
echo '[[audits.qlog]]'
echo 'who = "CI"'
echo 'criteria = "safe-to-deploy"'
echo "version = \"$QLOG_VERSION\""
} >> supply-chain/audits.toml
sed -i'' -e "s/qlog =.*/qlog = \"$QLOG_VERSION\"/" netwerk/socket/neqo_glue/Cargo.toml
{
echo '[patch."https://github.com/mozilla/neqo"]'
echo 'neqo-http3 = { path = "../neqo-http3" }'
echo 'neqo-transport = { path = "../neqo-transport" }'
echo 'neqo-common = { path = "../neqo-common" }'
echo 'neqo-qpack = { path = "../neqo-qpack" }'
echo 'neqo-crypto = { path = "../neqo-crypto" }'
} >> Cargo.toml
# shellcheck disable=SC2046
cargo update $(ls ../neqo-*)
./mach vendor rust --ignore-modified
- name: Build Firefox
env:
NAME: ${{ runner.os == 'MacOS' && 'Nightly' || 'bin' }}
TYPE: ${{ runner.os == 'MacOS' && matrix.type == 'debug' && 'Debug' || '' }}
EXT: ${{ runner.os == 'MacOS' && '.app' || '' }}
run: |
cd mozilla-unified
./mach build && tar -cf "../$FIREFOX.tar" -C "../$FIREFOX/dist" "$NAME$TYPE$EXT"
exit 0
- name: Export binary
id: export
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: ${{ matrix.os }}-${{ env.FIREFOX }}-${{ matrix.type }}.tgz
path: ${{ env.FIREFOX }}.tar
compression-level: 9
- run: echo "${{ steps.export.outputs.artifact-url }}" >> artifact
- name: Export artifact URL
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: artifact-${{ matrix.os }}-${{ env.FIREFOX }}-${{ matrix.type }}
path: artifact
comment:
name: Comment on PR
runs-on: ubuntu-latest
needs: firefox
steps:
- uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
with:
pattern: 'artifact-*'
path: artifacts
- run: |
{
echo "### Firefox builds for this PR"
for os in "${{ job.firefox.strategy.matrix.os }}"; do
echo -n "* **$os**:"
for type in "${{ job.firefox.strategy.matrix.type }}"; do
echo -n " [$type]($(cat artifacts/artifact-$os-${{ env.FIREFOX }}-$type))"
done
echo
done
} > comment.md
- uses: ./.github/actions/pr-comment-data-export
with:
name: firefox
contents: comment.md