forked from OpenEVSE/openevse_esp32_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (88 loc) · 2.76 KB
/
release_validation.yaml
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
name: Release Validation
on:
release:
types:
- released
- prereleased
- edited
jobs:
gui_validation:
name: Pre-built GUI Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
### Check the pre-built GUI files are up-to-date
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Set up Node JS
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
cd gui-v2
npm install
- name: Build GUI
run: |
cd gui-v2
npm run build
- name: Run PlatformIO
run:
pio run
- name: Check the pre-built GUI files are up-to-date
run: |
set +e
git status -s | grep " M "
if [ $? -eq 0 ]; then
echo "ERROR: The pre-built GUI files are not up-to-date"
exit 1
fi
release_number:
name: Release Number Validation
runs-on: ubuntu-latest
if: github.ref_name != 'latest'
steps:
### Check the version number in the code matches the tag number
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Retrieve the version number(s)
run: |
TAG_VERSION=$GITHUB_REF_NAME
CODE_VERSION=$(python3 scripts/auto_fw_version.py | grep -E 'BUILD_TAG=([^ ]+)' -o | cut -d= -f2)
echo TAG_VERSION=$TAG_VERSION >> $GITHUB_ENV
echo CODE_VERSION=$CODE_VERSION >> $GITHUB_ENV
- name: Check the version number is semver compliant
run: |
if ! [[ $TAG_VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-z]*[0-9]+)?$ ]]; then
echo "ERROR: The version number is not semver compliant"
exit 1
fi
- name: Check the version number in the code matches the tag number
run: |
if [ "$TAG_VERSION" != "$CODE_VERSION" ]; then
echo "ERROR: The version number in the code ($CODE_VERSION) does not match the tag number ($TAG_VERSION)"
exit 1
fi