|
| 1 | +# Run whenever a PR is generated or updated. |
| 2 | + |
| 3 | +# Most jobs check out the code, ensure Python3 is installed, and for build |
| 4 | +# tests the ESP8266 toolchain is cached when possible to speed up execution. |
| 5 | + |
| 6 | +name: ESP8266 Arduino CI |
| 7 | + |
| 8 | +on: |
| 9 | + pull_request: |
| 10 | + |
| 11 | + |
| 12 | +jobs: |
| 13 | + |
| 14 | +# Run 8 parallel jobs for the default build of all examples. |
| 15 | + build-linux: |
| 16 | + name: Build ${{ matrix.chunk }} |
| 17 | + runs-on: ubuntu-latest |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + chunk: [0, 1, 2, 3, 4, 5, 6, 7] |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + with: |
| 24 | + submodules: true |
| 25 | + - uses: actions/setup-python@v2 |
| 26 | + with: |
| 27 | + python-version: '3.x' |
| 28 | + - name: Cache Linux toolchain |
| 29 | + id: cache-linux |
| 30 | + uses: actions/cache@v2 |
| 31 | + with: |
| 32 | + path: ./tools/dist |
| 33 | + key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} |
| 34 | + - name: Build Sketches |
| 35 | + env: |
| 36 | + TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 37 | + TRAVIS_TAG: ${{ github.ref }} |
| 38 | + BUILD_PARITY: custom |
| 39 | + mod: 8 |
| 40 | + rem: ${{ matrix.chunk }} |
| 41 | + run: | |
| 42 | + bash ./tests/build.sh |
| 43 | + |
| 44 | + |
| 45 | +# Cover the debug and IPv6 cases by enabling both and running 8 parallel jobs |
| 46 | +# over all example code. |
| 47 | + build-debug-ipv6: |
| 48 | + name: Debug IPv6 ${{ matrix.chunk }} |
| 49 | + runs-on: ubuntu-latest |
| 50 | + strategy: |
| 51 | + matrix: |
| 52 | + chunk: [0, 1, 2, 3, 4, 5, 6, 7] |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v2 |
| 55 | + with: |
| 56 | + submodules: true |
| 57 | + - uses: actions/setup-python@v2 |
| 58 | + with: |
| 59 | + python-version: '3.x' |
| 60 | + - name: Cache Linux toolchain |
| 61 | + id: cache-linux |
| 62 | + uses: actions/cache@v2 |
| 63 | + with: |
| 64 | + path: ./tools/dist |
| 65 | + key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} |
| 66 | + - name: Build Sketches |
| 67 | + env: |
| 68 | + TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 69 | + TRAVIS_TAG: ${{ github.ref }} |
| 70 | + BUILD_PARITY: custom |
| 71 | + mod: 8 |
| 72 | + rem: ${{ matrix.chunk }} |
| 73 | + run: | |
| 74 | + bash ./tests/debug6.sh |
| 75 | + |
| 76 | + |
| 77 | +# Single build under Windows to ensure the Win toolchain is good. |
| 78 | + build-windows: |
| 79 | + name: Windows |
| 80 | + runs-on: windows-latest |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v2 |
| 83 | + with: |
| 84 | + submodules: true |
| 85 | + - uses: actions/setup-python@v2 |
| 86 | + with: |
| 87 | + python-version: '3.x' |
| 88 | + - name: Cache Windows toolchain |
| 89 | + id: cache-windows |
| 90 | + uses: actions/cache@v2 |
| 91 | + with: |
| 92 | + path: ./tools/dist |
| 93 | + key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} |
| 94 | + - name: Build Sketch |
| 95 | + env: |
| 96 | + TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 97 | + TRAVIS_TAG: ${{ github.ref }} |
| 98 | + WINDOWS: 1 |
| 99 | + BUILD_PARITY: custom |
| 100 | + mod: 500 |
| 101 | + rem: 1 |
| 102 | + run: | |
| 103 | + # Windows has python3 already installed, but it's called "python". |
| 104 | + # Copy python.exe to the proper name so scripts "just work". |
| 105 | + try { Get-Command python3 } catch { copy (get-command python).source (get-command python).source.Replace("python.exe", "python3.exe") } |
| 106 | + bash ./tests/build.sh |
| 107 | + |
| 108 | + |
| 109 | +# Single build under macOS to ensure the Mac toolchain is good. |
| 110 | + build-mac: |
| 111 | + name: Mac |
| 112 | + runs-on: macOS-latest |
| 113 | + steps: |
| 114 | + - uses: actions/checkout@v2 |
| 115 | + with: |
| 116 | + submodules: true |
| 117 | + - uses: actions/setup-python@v2 |
| 118 | + with: |
| 119 | + python-version: '3.x' |
| 120 | + - name: Cache Mac toolchain |
| 121 | + id: cache-mac |
| 122 | + uses: actions/cache@v2 |
| 123 | + with: |
| 124 | + path: ./tools/dist |
| 125 | + key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} |
| 126 | + - name: Build Sketch |
| 127 | + env: |
| 128 | + TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 129 | + TRAVIS_TAG: ${{ github.ref }} |
| 130 | + MACOSX: 1 |
| 131 | + BUILD_PARITY: custom |
| 132 | + mod: 500 |
| 133 | + rem: 1 |
| 134 | + run: | |
| 135 | + bash ./tests/build.sh |
| 136 | + |
| 137 | + |
| 138 | +# Run a few Platform.IO jobs (not full suite) to check PIO integration. |
| 139 | + build-pio: |
| 140 | + name: Build Platform.IO |
| 141 | + runs-on: ubuntu-latest |
| 142 | + steps: |
| 143 | + - uses: actions/checkout@v2 |
| 144 | + with: |
| 145 | + submodules: true |
| 146 | + - uses: actions/setup-python@v2 |
| 147 | + with: |
| 148 | + python-version: '3.x' |
| 149 | + - name: Build subset on Platform.IO |
| 150 | + env: |
| 151 | + TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 152 | + TRAVIS_TAG: ${{ github.ref }} |
| 153 | + BUILD_PARITY: custom |
| 154 | + mod: 42 # Picked at random to give 4-5 builds and exit. |
| 155 | + rem: 13 |
| 156 | + run: | |
| 157 | + sudo apt update |
| 158 | + sudo apt install python3-pip python3-setuptools |
| 159 | + PATH=/home/runner/.local/bin:$PATH bash ./tests/platformio.sh |
| 160 | + |
| 161 | + |
| 162 | +# Run host test suite under valgrind for runtime checking of code. |
| 163 | + host-tests: |
| 164 | + name: Host tests |
| 165 | + runs-on: ubuntu-latest |
| 166 | + steps: |
| 167 | + - uses: actions/checkout@v2 |
| 168 | + with: |
| 169 | + submodules: true |
| 170 | + - uses: actions/setup-python@v2 |
| 171 | + with: |
| 172 | + python-version: '3.x' |
| 173 | + - name: Run host tests |
| 174 | + env: |
| 175 | + TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 176 | + TRAVIS_TAG: ${{ github.ref }} |
| 177 | + run: | |
| 178 | + sudo apt update |
| 179 | + sudo apt install valgrind lcov |
| 180 | + bash ./tests/ci/host_test.sh |
| 181 | + |
| 182 | + |
| 183 | +# Ensure Sphinx can build the documentation properly. |
| 184 | + documentation: |
| 185 | + name: Documentation |
| 186 | + runs-on: ubuntu-latest |
| 187 | + steps: |
| 188 | + - uses: actions/checkout@v2 |
| 189 | + with: |
| 190 | + submodules: true |
| 191 | + - uses: actions/setup-python@v2 |
| 192 | + with: |
| 193 | + python-version: '3.x' |
| 194 | + - name: Build documentation |
| 195 | + env: |
| 196 | + TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 197 | + TRAVIS_TAG: ${{ github.ref }} |
| 198 | + run: | |
| 199 | + sudo apt update |
| 200 | + sudo apt install python3-pip python3-setuptools |
| 201 | + # GitHub CI installs pip3 and setuptools outside the path. |
| 202 | + # Update the path to include them and run. |
| 203 | + PATH=/home/runner/.local/bin:$PATH pip3 install --user -r doc/requirements.txt |
| 204 | + PATH=/home/runner/.local/bin:$PATH bash ./tests/ci/build_docs.sh |
| 205 | + |
| 206 | + |
| 207 | +# Standard Arduino formatting in all the examples |
| 208 | + style-check: |
| 209 | + name: Style and formatting |
| 210 | + runs-on: ubuntu-latest |
| 211 | + steps: |
| 212 | + - uses: actions/checkout@v2 |
| 213 | + with: |
| 214 | + submodules: true |
| 215 | + - uses: actions/setup-python@v2 |
| 216 | + with: |
| 217 | + python-version: '3.x' |
| 218 | + - name: Style check |
| 219 | + env: |
| 220 | + TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 221 | + TRAVIS_TAG: ${{ github.ref }} |
| 222 | + run: | |
| 223 | + sudo apt update |
| 224 | + sudo apt install astyle |
| 225 | + bash ./tests/ci/style_check.sh |
| 226 | + |
| 227 | + |
| 228 | +# Quick test that the mocking builds succeed |
| 229 | + mock-check: |
| 230 | + name: Mock trivial test |
| 231 | + runs-on: ubuntu-latest |
| 232 | + steps: |
| 233 | + - uses: actions/checkout@v2 |
| 234 | + with: |
| 235 | + submodules: true |
| 236 | + - uses: actions/setup-python@v2 |
| 237 | + with: |
| 238 | + python-version: '3.x' |
| 239 | + - name: Mock build |
| 240 | + env: |
| 241 | + TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 242 | + TRAVIS_TAG: ${{ github.ref }} |
| 243 | + run: | |
| 244 | + bash ./tests/buildm.sh |
| 245 | + |
| 246 | + |
| 247 | +# Ensure no manual edits to boards.txt |
| 248 | + boards-check: |
| 249 | + name: Boards.txt check |
| 250 | + runs-on: ubuntu-latest |
| 251 | + steps: |
| 252 | + - uses: actions/checkout@v2 |
| 253 | + with: |
| 254 | + submodules: true |
| 255 | + - uses: actions/setup-python@v2 |
| 256 | + with: |
| 257 | + python-version: '3.x' |
| 258 | + - name: Cache Linux toolchain |
| 259 | + id: cache-linux |
| 260 | + uses: actions/cache@v2 |
| 261 | + with: |
| 262 | + path: ./tools/dist |
| 263 | + key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} |
| 264 | + - name: Boards.txt diff |
| 265 | + env: |
| 266 | + TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 267 | + TRAVIS_TAG: ${{ github.ref }} |
| 268 | + run: | |
| 269 | + bash ./tests/ci/build_boards.sh |
| 270 | + bash ./tests/ci/eboot_test.sh |
| 271 | + bash ./tests/ci/pkgrefs_test.sh |
0 commit comments