Skip to content

Commit c951325

Browse files
Merge pull request #834 from OpenEVSE/build_gui_workflow
Workflow to build the UI files
2 parents 52e074f + 66aae32 commit c951325

File tree

5 files changed

+108
-2158
lines changed

5 files changed

+108
-2158
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ permissions:
66
contents: write
77

88
on:
9-
workflow_dispatch:
10-
inputs:
11-
v2_ref:
12-
required: true
13-
description: The branch/tag for the v2 UI
14-
default: master
15-
169
push:
1710
branches:
1811
- master
@@ -34,7 +27,7 @@ jobs:
3427
run: echo "github.ref_name = '${{ github.ref_name }}'"
3528

3629
build:
37-
name: Build ${{ matrix.env }} with ${{ matrix.gui.name }}
30+
name: Build ${{ matrix.env }}
3831
runs-on: ubuntu-latest
3932

4033
strategy:
@@ -61,25 +54,12 @@ jobs:
6154
- elecrow_esp32_hmi_dev
6255
- openevse_wifi_tft_v1
6356
- openevse_wifi_tft_v1_dev
64-
gui:
65-
- name: gui-v2
66-
repo: OpenEVSE/openevse-gui-v2
67-
build_flags: ""
68-
ref: ${{ inputs.v2_ref }}
6957

7058
steps:
7159
- uses: ammaraskar/gcc-problem-matcher@master
7260

7361
- uses: actions/checkout@v4
7462

75-
- name: Checkout GUI
76-
uses: actions/checkout@v4
77-
with:
78-
repository: ${{ matrix.gui.repo }}
79-
path: ${{ matrix.gui.name }}
80-
ref: ${{ matrix.gui.ref }}
81-
submodules: recursive
82-
8363
- name: Cache pip
8464
uses: actions/cache@v4
8565
with:
@@ -104,26 +84,8 @@ jobs:
10484
python -m pip install --upgrade pip
10585
pip install --upgrade platformio
10686
107-
- name: Set up Node JS
108-
uses: actions/setup-node@v4
109-
with:
110-
node-version: '16'
111-
112-
- name: Install dependencies
113-
run: |
114-
cd ${{ matrix.gui.name }}
115-
npm install
116-
117-
- name: Build GUI
118-
run: |
119-
cd ${{ matrix.gui.name }}
120-
npm run build
121-
12287
- name: Run PlatformIO
12388
run: pio run -e ${{ matrix.env }}
124-
env:
125-
GUI_NAME: ${{ matrix.gui.name }}
126-
PLATFORMIO_BUILD_FLAGS: ${{ matrix.gui.build_flags }}
12789

12890
- name: Upload output to GitHub
12991
uses: actions/upload-artifact@v4

.github/workflows/build_gui.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: Build OpenEVSE GUI
4+
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
9+
on:
10+
workflow_dispatch:
11+
12+
pull_request:
13+
paths:
14+
- gui-v2
15+
- gui-tft/*
16+
17+
jobs:
18+
build:
19+
name: Build the static GUI files
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout the repository
24+
uses: actions/checkout@v4
25+
with:
26+
submodules: recursive
27+
28+
- name: Cache pip
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.cache/pip
32+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
33+
restore-keys: |
34+
${{ runner.os }}-pip-
35+
36+
- name: Cache PlatformIO
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.platformio
40+
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
41+
42+
- name: Set up Python
43+
uses: actions/setup-python@v5
44+
with:
45+
python-version: '3.x'
46+
47+
- name: Install PlatformIO
48+
run: |
49+
python -m pip install --upgrade pip
50+
pip install --upgrade platformio
51+
52+
- name: Set up Node JS
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: '20'
56+
57+
- name: Install dependencies
58+
run: |
59+
cd gui-v2
60+
npm install
61+
62+
- name: Build GUI
63+
run: |
64+
cd gui-v2
65+
npm run build
66+
67+
- name: Delete the existing pre-built GUI files
68+
run: |
69+
rm -fr src/lcd_static
70+
rm -f src/web_static/*.h
71+
72+
- name: Run PlatformIO
73+
run:
74+
pio run
75+
76+
- name: Push any changed files
77+
uses: stefanzweifel/git-auto-commit-action@v5
78+
with:
79+
commit_message: "Update of pre-built GUI files"

.github/workflows/release_validation.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,34 @@ jobs:
1717
submodules: recursive
1818

1919
### Check the pre-built GUI files are up-to-date
20+
- name: Cache pip
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.cache/pip
24+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
25+
restore-keys: |
26+
${{ runner.os }}-pip-
27+
28+
- name: Cache PlatformIO
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.platformio
32+
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: '3.x'
38+
39+
- name: Install PlatformIO
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install --upgrade platformio
2043
2144
- name: Set up Node JS
2245
uses: actions/setup-node@v4
2346
with:
24-
node-version: '16'
47+
node-version: '20'
2548

2649
- name: Install dependencies
2750
run: |
@@ -33,6 +56,10 @@ jobs:
3356
cd gui-v2
3457
npm run build
3558
59+
- name: Run PlatformIO
60+
run:
61+
pio run
62+
3663
- name: Check the pre-built GUI files are up-to-date
3764
run: |
3865
set +e

0 commit comments

Comments
 (0)