-
Notifications
You must be signed in to change notification settings - Fork 3
150 lines (127 loc) · 3.84 KB
/
build.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
name: Build
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
env:
NODE_VERSION: 15.x
ESP_IDF_VERSION: v4.4.6
ESP8266_RTOS_SDK_VERSION: v3.4
jobs:
build-web:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: web
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Upload web-dist
uses: actions/upload-artifact@v3
with:
name: web-dist
path: web/dist/
if-no-files-found: error
# requires web/dist directory to exist
build-esp32:
needs:
- build-web
runs-on: ubuntu-20.04
steps:
- name: Setup
run: |
echo "BUILD_UID=$(id -u)" >> $GITHUB_ENV
echo "BUILD_GID=$(id -g)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
- name: Download web-dist
uses: actions/download-artifact@v3
with:
name: web-dist
path: web/dist
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
# XXX: build --load -> build --output=type=docker is almost as slow as uncached build...
- name: Build SDK
uses: docker/build-push-action@v3
with:
build-args: |
ESP_IDF_VERSION=${{ env.ESP_IDF_VERSION }}
BUILD_UID=${{ env.BUILD_UID }}
BUILD_GID=${{ env.BUILD_GID }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: sdk/esp-idf
load: true
push: false
tags: qmsk/esp-idf:dev
- name: Build
run: docker-compose -f projects/esp32/docker-compose.yml run --rm build
- name: Upload esp32-build
uses: actions/upload-artifact@v3
with:
name: esp32-build
path: |
projects/esp32/build/bootloader/*.bin
projects/esp32/build/bootloader/*.map
projects/esp32/build/bootloader/*.elf
projects/esp32/build/partition_table/*.bin
projects/esp32/build/*.bin
projects/esp32/build/*.map
projects/esp32/build/*.elf
projects/esp32/build/flash_project_args
projects/esp32/build/flasher_args.json
if-no-files-found: error
# requires web/dist directory to exist
build-esp8266:
needs:
- build-web
runs-on: ubuntu-20.04
steps:
- name: Setup
run: |
echo "USER_ID=$(id -u)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
- name: Download web-dist
uses: actions/download-artifact@v3
with:
name: web-dist
path: web/dist
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
# XXX: build --load -> build --output=type=docker is almost as slow as uncached build...
- name: Build SDK
uses: docker/build-push-action@v3
with:
build-args: |
ESP8266_RTOS_SDK_VERSION=${{ env.ESP8266_RTOS_SDK_VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: sdk/esp8266-rtos-sdk
load: true
push: false
tags: qmsk/esp8266-rtos-sdk:dev
- name: Build
run: docker-compose -f projects/esp8266/docker-compose.yml run --rm build make defconfig all write_flash_args
- name: Upload esp8266-build
uses: actions/upload-artifact@v3
with:
name: esp8266-build
path: |
projects/esp8266/build/*.bin
projects/esp8266/build/*.map
projects/esp8266/build/*.elf
projects/esp8266/build/flash_args
if-no-files-found: error