Repository navigation
111 lines (108 loc) · 4 KB
/
Copy pathbuild.yml
File metadata and controls
111 lines (108 loc) · 4 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
name: Build BGP
run-name: Build BGP
on:
# Build on every PR raised against the OSS repo
pull_request:
# Allow manually triggering the workflow
workflow_dispatch:
# Periodic daily build to catch breakages from upstream dependency drift
# even when no PR is open.
# ShipIt syncs hourly around HH:21, so schedule with a ~15 minute offset so
# the run picks up the freshest sync.
schedule:
# Run daily at 7:36AM UTC = 12:36AM PDT
- cron: '36 7 * * *'
# Cancel a superseded run when new commits are pushed to the same PR.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
BGP-Build:
name: BGP-${{ matrix.variant }}
runs-on: 32-core-ubuntu
env:
FBOSS_BUILD_PROFILE: ${{ matrix.fboss_profile }}
strategy:
fail-fast: false
matrix:
include:
- variant: dc
fboss_profile: fsdb_client
- variant: bb
fboss_profile: exported_libraries
steps:
- run: echo "Confirming hardware specifications:"; sudo lscpu
- name: Clean workspace
run: sudo rm -rf ${{ github.workspace }}/*
- name: Check out repository code
uses: actions/checkout@v7
# Build DC against the FBOSS fsdb_client profile and BB against the
# smaller exported_libraries profile. Separate build directories ensure
# each variant configures and installs its own dependency closure.
# --num-jobs is capped below the core count because large Folly and
# Thrift translation units can exhaust the runner's memory.
# --scratch-path MUST live OUTSIDE the checkout: getdeps applies dependency
# patches with `git apply` after cd-ing to the enclosing git repo root, so a
# scratch dir nested in this repo makes it patch from the BGP root and fail
# (e.g. boost -> "No such file or directory"). runner.temp is a sibling of
# the checkout and is not a git repo.
- name: Build BGP ${{ matrix.variant }} (getdeps / CMake)
run: >
sudo
env
BUILD_SAI_FAKE=1
FBOSS_BUILD_PROFILE=${{ matrix.fboss_profile }}
python3
build/fbcode_builder/getdeps.py
--allow-system-packages
--scratch-path
${{ runner.temp }}/bgp-build-${{ matrix.variant }}
build
--extra-cmake-defines='{"BGP_BUILD_VARIANT":"${{ matrix.variant }}"}'
--src-dir=.
--num-jobs
18
bgp
- name: Test BGP ${{ matrix.variant }} (getdeps / CTest)
run: >
sudo
env
BUILD_SAI_FAKE=1
FBOSS_BUILD_PROFILE=${{ matrix.fboss_profile }}
python3
build/fbcode_builder/getdeps.py
--allow-system-packages
--scratch-path
${{ runner.temp }}/bgp-build-${{ matrix.variant }}
test
--extra-cmake-defines='{"BGP_BUILD_VARIANT":"${{ matrix.variant }}"}'
--src-dir=.
--num-jobs
18
bgp
- name: Restore build ownership
if: always()
run: >
sudo chown -R runner:runner
${{ runner.temp }}/bgp-build-${{ matrix.variant }}
${{ github.workspace }}
# Retain the build output only for non-PR runs (daily schedule + manual
# dispatch). PRs skip artifact upload so they do not pile up artifacts.
- name: Locate BGP install directory
if: github.event_name != 'pull_request'
id: instdir
run: >
echo "dir=$(python3 build/fbcode_builder/getdeps.py
--scratch-path ${{ runner.temp }}/bgp-build-${{ matrix.variant }}
show-inst-dir
--extra-cmake-defines='{"BGP_BUILD_VARIANT":"${{ matrix.variant }}"}'
--src-dir=. bgp)" >> "$GITHUB_OUTPUT"
- name: Upload BGP build output
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v7
with:
name: bgp-${{ matrix.variant }}
path: ${{ steps.instdir.outputs.dir }}
retention-days: 14