Skip to content

Commit 0aab6ec

Browse files
authored
Rework CI workflows (#8688)
- split workflows into separate files to trigger by path this should help out documentation and boards / eboot / pkg files updates, since those *wont* trigger usual build stuff anymore - build*.sh whatever merged into just common.sh and build.sh trigger different parity builds, mod % rem and allow to set .ino list through the environment variable - removes unnecessary temporary files, try to use more pipes move remaining ones into cache dir instead of PWD - remove legacy TRAVIS env vars, use ESP8266_ARDUINO prefix for config - remove Windows path workarounds - hardware/ and ide/ directories are set through envionment do not force specific paths, simplify builds on local machine - sketch list is set through environment. expicit paths for Windows and macOS builders. platformio also gets a real shuffled list instead of mod and rem magic numbers - detect root of the repo through git cli, not base{name,dir} or relative paths
1 parent 2360d1c commit 0aab6ec

28 files changed

+924
-771
lines changed

.github/workflows/build-host.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Run host test suite under valgrind for runtime checking of code.
2+
# Also, a quick test that the mocking builds work at all
3+
4+
name: Build on host OS
5+
6+
on:
7+
pull_request:
8+
paths-ignore:
9+
- "boards.txt"
10+
- "package/**"
11+
- "tools/boards.txt.py"
12+
- 'doc/**'
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
host-tests:
19+
name: Tests
20+
runs-on: ubuntu-latest
21+
defaults:
22+
run:
23+
shell: bash
24+
steps:
25+
- uses: actions/checkout@v3
26+
with:
27+
submodules: true
28+
- run: |
29+
sudo apt update
30+
sudo apt install valgrind lcov
31+
bash ./tests/ci/host_test.sh
32+
33+
mock-check:
34+
name: Mock
35+
runs-on: ubuntu-latest
36+
defaults:
37+
run:
38+
shell: bash
39+
steps:
40+
- uses: actions/checkout@v3
41+
with:
42+
submodules: true
43+
- run: |
44+
cd tests/host
45+
make -j ../../libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser

.github/workflows/build-ide.yml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Cross-platform builds to ensure our Core and toolchain works
2+
3+
name: Build IDE examples
4+
5+
on:
6+
pull_request:
7+
paths-ignore:
8+
- "boards.txt"
9+
- "package/**"
10+
- "tools/boards.txt.py"
11+
- 'doc/**'
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
18+
# Examples are built in parallel to avoid CI total job time limitation
19+
20+
build-linux:
21+
name: Linux - LwIP ${{ matrix.lwip }} (${{ matrix.chunk }})
22+
runs-on: ubuntu-latest
23+
defaults:
24+
run:
25+
shell: bash
26+
strategy:
27+
matrix:
28+
lwip: ["default", "IPv6"]
29+
chunk: [0, 1, 2, 3, 4, 5, 6, 7]
30+
steps:
31+
- uses: actions/checkout@v3
32+
with:
33+
submodules: true
34+
- uses: actions/setup-python@v4
35+
with:
36+
python-version: '3.x'
37+
- uses: actions/cache@v3
38+
with:
39+
path: ./tools/dist
40+
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh', 'tests/build.sh') }}
41+
- name: Build Sketches
42+
env:
43+
ESP8266_ARDUINO_BUILDER: "arduino"
44+
ESP8266_ARDUINO_IDE: "${{ runner.temp }}/arduino_ide"
45+
ESP8266_ARDUINO_LWIP: ${{ matrix.lwip }}
46+
run: |
47+
bash ./tests/build.sh 8 ${{ matrix.chunk }}
48+
49+
# Just try to build at least one sketch, since we spend so much time with the matrix above
50+
51+
build-windows:
52+
name: Windows
53+
runs-on: windows-latest
54+
steps:
55+
- uses: actions/checkout@v3
56+
with:
57+
submodules: false
58+
- uses: actions/setup-python@v4
59+
with:
60+
python-version: '3.x'
61+
- uses: actions/cache@v3
62+
with:
63+
path: ./tools/dist
64+
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh', 'tests/build.sh') }}
65+
- name: Build Sketch
66+
env:
67+
ESP8266_ARDUINO_HARDWARE: "${{ runner.temp }}/hardware"
68+
ESP8266_ARDUINO_IDE: "${{ runner.temp }}/arduino_ide"
69+
ESP8266_ARDUINO_SKETCHES: "libraries/esp8266/examples/Blink/Blink.ino"
70+
run: |
71+
bash ./tests/build.sh
72+
73+
build-mac:
74+
name: macOS
75+
runs-on: macOS-latest
76+
defaults:
77+
run:
78+
shell: bash
79+
steps:
80+
- uses: actions/checkout@v3
81+
with:
82+
submodules: false
83+
- uses: actions/setup-python@v4
84+
with:
85+
python-version: '3.x'
86+
- uses: actions/cache@v3
87+
with:
88+
path: ./tools/dist
89+
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh', 'tests/build.sh') }}
90+
- name: Build Sketch
91+
env:
92+
ESP8266_ARDUINO_HARDWARE: "${{ runner.temp }}/hardware"
93+
ESP8266_ARDUINO_IDE: "${{ runner.temp }}/arduino_ide"
94+
ESP8266_ARDUINO_SKETCHES: "libraries/esp8266/examples/Blink/Blink.ino"
95+
run: |
96+
bash ./tests/build.sh
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# We do not distribute any environment settings, so just try to build some sketches
2+
# using the 'master' branch and using the uploaded toolchain version via get.py
3+
# Also, limit the amount of sketches and simply
4+
5+
name: Build examples with PlatformIO
6+
7+
on:
8+
pull_request:
9+
paths-ignore:
10+
- "boards.txt"
11+
- "tools/boards.txt.py"
12+
- 'doc/**'
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
build-pio:
19+
name: Linux (random sketches)
20+
runs-on: ubuntu-latest
21+
defaults:
22+
run:
23+
shell: bash
24+
steps:
25+
- uses: actions/checkout@v3
26+
with:
27+
submodules: true
28+
- uses: actions/setup-python@v4
29+
with:
30+
python-version: '3.x'
31+
- uses: actions/cache@v3
32+
with:
33+
path: |
34+
tools/dist
35+
~/.cache/pip
36+
~/.platformio/.cache
37+
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh', 'tests/build.sh') }}
38+
- name: Build
39+
env:
40+
ESP8266_ARDUINO_BUILDER: "platformio"
41+
run: |
42+
pip install -U platformio
43+
env ESP8266_ARDUINO_SKETCHES="$(find libraries/ -name '*.ino' | shuf -n 10 -)" bash ./tests/build.sh
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Ensure no manual edits happen to our autogenerated files
2+
3+
name: Check autogenerated files
4+
5+
on:
6+
pull_request:
7+
paths:
8+
- "boards.txt"
9+
- "bootloaders/**"
10+
- "doc/boards.rst"
11+
- "package/**"
12+
- "tools/boards.txt.py"
13+
- "tools/sdk/ld/**"
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
pkgrefs-check:
20+
name: .json template
21+
runs-on: ubuntu-latest
22+
defaults:
23+
run:
24+
shell: bash
25+
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
submodules: false
29+
- run: |
30+
bash ./tests/ci/pkgrefs_test.sh
31+
32+
eboot-check:
33+
name: eboot .elf
34+
runs-on: ubuntu-latest
35+
defaults:
36+
run:
37+
shell: bash
38+
steps:
39+
- uses: actions/checkout@v3
40+
with:
41+
submodules: false
42+
- uses: actions/setup-python@v4
43+
with:
44+
python-version: '3.x'
45+
- uses: actions/cache@v3
46+
with:
47+
path: ./tools/dist
48+
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }}
49+
- run: |
50+
# ^ reuse toolchain cache from our linux build job
51+
git submodule update --init --remote tools/sdk/uzlib
52+
bash ./tests/ci/eboot_test.sh
53+
54+
boards-txt-check:
55+
name: boards.txt.py
56+
runs-on: ubuntu-latest
57+
defaults:
58+
run:
59+
shell: bash
60+
steps:
61+
- uses: actions/checkout@v3
62+
with:
63+
submodules: false
64+
- uses: actions/setup-python@v4
65+
with:
66+
python-version: '3.x'
67+
- name: Check git-diff result
68+
run: |
69+
bash ./tests/ci/build_boards.sh

.github/workflows/documentation.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Ensure Sphinx can build the documentation properly.
2+
3+
name: Documentation
4+
5+
on:
6+
pull_request:
7+
paths:
8+
- 'doc/**'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
documentation:
15+
name: Sphinx build
16+
runs-on: ubuntu-latest
17+
defaults:
18+
run:
19+
shell: bash
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
submodules: true
24+
- uses: actions/setup-python@v4
25+
with:
26+
python-version: '3.x'
27+
- name: Build documentation
28+
run: |
29+
pip install --user -r doc/requirements.txt
30+
bash ./tests/ci/build_docs.sh

0 commit comments

Comments
 (0)