Skip to content

Commit

Permalink
Rework CI workflows (#8688)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
mcspr committed Oct 31, 2022
1 parent 2360d1c commit 0aab6ec
Show file tree
Hide file tree
Showing 28 changed files with 924 additions and 771 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-host.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Run host test suite under valgrind for runtime checking of code.
# Also, a quick test that the mocking builds work at all

name: Build on host OS

on:
pull_request:
paths-ignore:
- "boards.txt"
- "package/**"
- "tools/boards.txt.py"
- 'doc/**'

permissions:
contents: read

jobs:
host-tests:
name: Tests
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: |
sudo apt update
sudo apt install valgrind lcov
bash ./tests/ci/host_test.sh
mock-check:
name: Mock
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: |
cd tests/host
make -j ../../libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser
96 changes: 96 additions & 0 deletions .github/workflows/build-ide.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Cross-platform builds to ensure our Core and toolchain works

name: Build IDE examples

on:
pull_request:
paths-ignore:
- "boards.txt"
- "package/**"
- "tools/boards.txt.py"
- 'doc/**'

permissions:
contents: read

jobs:

# Examples are built in parallel to avoid CI total job time limitation

build-linux:
name: Linux - LwIP ${{ matrix.lwip }} (${{ matrix.chunk }})
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
matrix:
lwip: ["default", "IPv6"]
chunk: [0, 1, 2, 3, 4, 5, 6, 7]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/cache@v3
with:
path: ./tools/dist
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh', 'tests/build.sh') }}
- name: Build Sketches
env:
ESP8266_ARDUINO_BUILDER: "arduino"
ESP8266_ARDUINO_IDE: "${{ runner.temp }}/arduino_ide"
ESP8266_ARDUINO_LWIP: ${{ matrix.lwip }}
run: |
bash ./tests/build.sh 8 ${{ matrix.chunk }}
# Just try to build at least one sketch, since we spend so much time with the matrix above

build-windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: false
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/cache@v3
with:
path: ./tools/dist
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh', 'tests/build.sh') }}
- name: Build Sketch
env:
ESP8266_ARDUINO_HARDWARE: "${{ runner.temp }}/hardware"
ESP8266_ARDUINO_IDE: "${{ runner.temp }}/arduino_ide"
ESP8266_ARDUINO_SKETCHES: "libraries/esp8266/examples/Blink/Blink.ino"
run: |
bash ./tests/build.sh
build-mac:
name: macOS
runs-on: macOS-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: false
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/cache@v3
with:
path: ./tools/dist
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh', 'tests/build.sh') }}
- name: Build Sketch
env:
ESP8266_ARDUINO_HARDWARE: "${{ runner.temp }}/hardware"
ESP8266_ARDUINO_IDE: "${{ runner.temp }}/arduino_ide"
ESP8266_ARDUINO_SKETCHES: "libraries/esp8266/examples/Blink/Blink.ino"
run: |
bash ./tests/build.sh
43 changes: 43 additions & 0 deletions .github/workflows/build-platformio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# We do not distribute any environment settings, so just try to build some sketches
# using the 'master' branch and using the uploaded toolchain version via get.py
# Also, limit the amount of sketches and simply

name: Build examples with PlatformIO

on:
pull_request:
paths-ignore:
- "boards.txt"
- "tools/boards.txt.py"
- 'doc/**'

permissions:
contents: read

jobs:
build-pio:
name: Linux (random sketches)
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/cache@v3
with:
path: |
tools/dist
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh', 'tests/build.sh') }}
- name: Build
env:
ESP8266_ARDUINO_BUILDER: "platformio"
run: |
pip install -U platformio
env ESP8266_ARDUINO_SKETCHES="$(find libraries/ -name '*.ino' | shuf -n 10 -)" bash ./tests/build.sh
69 changes: 69 additions & 0 deletions .github/workflows/check-autogenerated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Ensure no manual edits happen to our autogenerated files

name: Check autogenerated files

on:
pull_request:
paths:
- "boards.txt"
- "bootloaders/**"
- "doc/boards.rst"
- "package/**"
- "tools/boards.txt.py"
- "tools/sdk/ld/**"

permissions:
contents: read

jobs:
pkgrefs-check:
name: .json template
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: false
- run: |
bash ./tests/ci/pkgrefs_test.sh
eboot-check:
name: eboot .elf
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: false
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/cache@v3
with:
path: ./tools/dist
key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }}
- run: |
# ^ reuse toolchain cache from our linux build job
git submodule update --init --remote tools/sdk/uzlib
bash ./tests/ci/eboot_test.sh
boards-txt-check:
name: boards.txt.py
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: false
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Check git-diff result
run: |
bash ./tests/ci/build_boards.sh
30 changes: 30 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Ensure Sphinx can build the documentation properly.

name: Documentation

on:
pull_request:
paths:
- 'doc/**'

permissions:
contents: read

jobs:
documentation:
name: Sphinx build
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Build documentation
run: |
pip install --user -r doc/requirements.txt
bash ./tests/ci/build_docs.sh
Loading

0 comments on commit 0aab6ec

Please sign in to comment.