-
Notifications
You must be signed in to change notification settings - Fork 252
133 lines (114 loc) · 3.59 KB
/
Copy pathbuild-prf.yml
File metadata and controls
133 lines (114 loc) · 3.59 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Build PRF
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
changes-prf:
runs-on: ubuntu-24.04
permissions:
pull-requests: read
outputs:
should-build: ${{ github.event_name == 'push' || steps.filter.outputs.src == 'true' }}
steps:
- uses: dorny/paths-filter@v4
if: github.event_name == 'pull_request'
id: filter
with:
filters: |
src:
- '.github/actions/**'
- '.github/workflows/build-prf.yml'
- 'boards/**'
- 'platform/**'
- 'resources/**'
- 'src/**'
- 'tools/**'
- 'third_party/**'
- 'tools/waf/**'
- 'waf'
- 'wscript'
build-prf:
needs: changes-prf
if: needs.changes-prf.outputs.should-build == 'true'
runs-on: ubuntu-24.04
container:
image: ghcr.io/coredevices/pebbleos-docker:v6
strategy:
matrix:
board:
- asterix
- obelix@dvt
- obelix@pvt
- getafix@evt
- getafix@dvt
- getafix@dvt2
mode:
- normal
- mfg
steps:
- name: Mark Github workspace as safe
run: git config --system --add safe.directory "${GITHUB_WORKSPACE}"
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true
- name: Rebase onto target branch
uses: ./.github/actions/rebase
with:
submodules: true
- name: Install Python dependencies
run: |
pip install -U pip
pip install -r requirements.txt
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Set artifact board name
id: artifact_board
run: echo "NAME=$(printf '%s' "$BOARD" | tr @ _)" >> "$GITHUB_OUTPUT"
env:
BOARD: ${{ matrix.board }}
- name: Configure
run: |
if [ "${{ matrix.mode }}" == "mfg" ]; then
OPTS="-DCONFIG_MFG=y -DCONFIG_LOG_HASHED=n"
fi
./waf configure --board '${{ matrix.board }}' --variant=prf $OPTS
- name: Build
run: ./waf build
- name: Bundle
run: ./waf bundle
- name: Store
uses: actions/upload-artifact@v6
with:
name: prf-${{ steps.artifact_board.outputs.NAME }}-${{ matrix.mode }}
path: |
build/**/*.elf
build/**/*.pbz
build/pebbleos_loghash_dict.json
- name: Get Build ID
id: build_id
run: |
echo "BUILD_ID=$(readelf -n build/pebbleos.elf | sed -n -e 's/^.*Build ID: //p')" >> "$GITHUB_OUTPUT"
- name: Upload log hash dictionary
if: ${{ github.event_name == 'push' && github.repository == 'coredevices/PebbleOS' }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.LOG_HASH_BUCKET_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.LOG_HASH_BUCKET_SECRET }}
AWS_DEFAULT_REGION: us-east-1
run: |
pip install awscli
aws s3 cp build/pebbleos_loghash_dict.json \
"s3://${{ vars.LOG_HASH_BUCKET_NAME }}/${{ steps.build_id.outputs.BUILD_ID }}-${{ github.sha }}-prf.json" \
--endpoint-url "${{ vars.LOG_HASH_BUCKET_ENDPOINT }}"
build-prf-status:
needs: [changes-prf, build-prf]
if: always()
runs-on: ubuntu-24.04
steps:
- if: needs.build-prf.result == 'failure' || needs.build-prf.result == 'cancelled'
run: exit 1