-
-
Notifications
You must be signed in to change notification settings - Fork 93
141 lines (120 loc) · 4.13 KB
/
Copy pathpr.yml
File metadata and controls
141 lines (120 loc) · 4.13 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
134
135
136
137
138
139
140
141
name: PR Incremental Build
on:
pull_request:
branches:
- main
- dev
paths-ignore:
- '.vscode/**'
- '.gitignore'
- 'LICENSE'
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
littlefs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
sparse-checkout: 'data'
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Cache Bun dependencies
uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('data/bun.lockb', 'data/package.json') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install LittleFS Tool
run: pip install littlefs-python
- name: Install dependencies
run: bun install
working-directory: data
- name: Build
run: bun run build
working-directory: data
- name: Remove extra, only keep compressed
run: find dist -regex ".*\.\(html\|css\|br\|js\|json.gz\)" -delete
working-directory: data
- name: Create LittleFS Image
run: littlefs-python create $(pwd)/dist littlefs.bin -v --fs-size=0x20000 --name-max=64 --block-size=4096
working-directory: data
- name: Archive build directory
uses: actions/upload-artifact@v7
with:
name: ui-build-directory
path: data/dist
retention-days: 1
build-matrix:
runs-on: ubuntu-latest
needs: littlefs
strategy:
fail-fast: false
matrix:
target: [esp32, esp32c3, esp32c6, esp32s3]
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
submodules: 'recursive'
- name: Get UI Build Directory
uses: actions/download-artifact@v8
with:
name: ui-build-directory
path: data/dist
- name: Restore Incremental Cache
uses: actions/cache@v5
with:
path: |
$HOME/.ccache
managed_components
build
key: ${{ runner.os }}-${{ matrix.target }}-incremental-${{ github.event.pull_request.number }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.target }}-incremental-${{ github.event.pull_request.number }}-
${{ runner.os }}-${{ matrix.target }}-incremental-
${{ runner.os }}-${{ matrix.target }}-build
- name: Fix directory permissions for Docker
run: |
mkdir -p build managed_components $HOME/.ccache
sudo chown -R 1000:1000 build managed_components $HOME/.ccache
- name: ESP-IDF Incremental Build (${{ matrix.target }})
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v5.5.5
target: ${{ matrix.target }}
path: '.'
extra_docker_args: >-
-v ${{ github.workspace }}/build:/project/build
-v ${{ github.workspace }}/managed_components:/project/managed_components
-v $HOME/.ccache:/root/.ccache
-e CCACHE_DIR=/root/.ccache
command: |
CI=true idf.py --ccache build && idf.py merge-bin
- name: Fix ownership post-build
run: sudo chown -R $USER:$USER build/ managed_components/ $HOME/.ccache
- name: Organize Binaries
run: |
mv build/HomeKey-ESP32.bin build/${{ matrix.target }}.firmware.bin
mv build/merged-binary.bin build/${{ matrix.target }}.firmware.factory.bin
- name: Archive Firmware
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.target }}-firmware
path: build/${{ matrix.target }}.firmware.bin
- name: Archive Factory Firmware
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.target }}-firmware-factory
path: build/${{ matrix.target }}.firmware.factory.bin