-
-
Notifications
You must be signed in to change notification settings - Fork 179
108 lines (93 loc) · 3.66 KB
/
macOS-generate-profile-data-and-jarlog.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
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Please write our copyright if you use this file.
# © 2023 Floorp Projects & Contributors
on:
workflow_call:
secrets:
PAT:
description: "Personal Access Token for checkout"
required: true
workflow_dispatch:
jobs:
macOS-Universal-gen-profdata-and-jarlog:
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
runs-on: [macos-13, macos-14]
# macos-latest-large is x86_64 and macos-latest is arm64
steps:
- name: Init
run: |
sysctl machdep.cpu
export RUNNER_USERDIR=`echo ~`
echo "RUNNER_USERDIR=$RUNNER_USERDIR" >> $GITHUB_ENV
mkdir -p ~/downloads/artifacts
- uses: actions/checkout@v4
name: Clone 🧬
with:
submodules: 'recursive'
token: ${{ secrets.PAT }}
- name: Check Arch type
shell: bash
run: |
if [[ $GHA_BUILD_MACHINE != 'macos-13' ]]; then
export ARCH_TYPE=`echo "aarch64"`
echo "ARCH_TYPE=$ARCH_TYPE" >> $GITHUB_ENV
else
export ARCH_TYPE=`echo "x86_64"`
echo "ARCH_TYPE=$ARCH_TYPE" >> $GITHUB_ENV
fi
env:
GHA_BUILD_MACHINE: ${{ matrix.runs-on }}
- uses: actions/download-artifact@v4
id: download-artifacts-mac-enable-profgen
name: Download artifact 📥
with:
name: floorp-mac-${{ env.ARCH_TYPE }}-build-with-profgen
path: ~/downloads/artifacts
- name: force install python3.12
continue-on-error: true
run: |
brew install [email protected]
- name: force link python3.12
continue-on-error: true
run: |
# due to "Error: The `brew link` step did not complete successfully" we need to force link python3.12
brew link --force --overwrite [email protected]
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: setup environment 🌲
run: |
echo -e "ac_add_options --enable-bootstrap" >> mozconfig
echo 'mozconfig: **********************'
cat ./mozconfig
echo '*********************************'
brew install gnu-tar
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH
./mach --no-interactive bootstrap --application-choice browser
- name: Install setup tool via PIP 📦
run: |
pip install setuptools
- name: Extract artifact 📂
run: |
mkdir -p ./floorp
cp ${{ steps.download-artifacts-mac-enable-profgen.outputs.download-path }}/${ARCH_TYPE}-apple-darwin-output.tar.xz ./
tar xf ${ARCH_TYPE}-apple-darwin-output.tar.xz
## ./mach python python/mozbuild/mozbuild/action/install.py $MOZ_FETCHES_DIR/target.dmg $MOZ_FETCHES_DIR
- name: Generate Profdata 📊
run: |
export LLVM_PROFDATA=$RUNNER_USERDIR/.mozbuild/clang/bin/llvm-profdata
export JARLOG_FILE="en-US.log"
./mach python build/pgo/profileserver.py --binary ./obj-${ARCH_TYPE}-apple-darwin/dist/floorp/Floorp.app/Contents/MacOS/floorp
env:
GHA_BUILD_MACHINE: ${{ matrix.runs-on }}
- name: Publish 🎁
uses: actions/upload-artifact@v4
with:
name: floorp-${{ env.ARCH_TYPE }}-apple-darwin-profdata-and-jarlog
path: |
merged.profdata
en-US.log