Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework CI workflows #8688

Merged
merged 18 commits into from
Oct 31, 2022
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