2020-03-01 03:05:48 +00:00
|
|
|
name: Continuous Integration
|
2020-03-16 00:42:48 +00:00
|
|
|
on:
|
2021-04-16 01:39:10 +00:00
|
|
|
# Triggers the workflow on push or pull request events but only for the master branch
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
2022-01-27 17:59:08 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
- '**.yml'
|
2021-04-16 01:39:10 +00:00
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
2022-01-27 17:59:08 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
- '**.yml'
|
2020-02-27 01:20:19 +00:00
|
|
|
jobs:
|
2021-04-16 01:39:10 +00:00
|
|
|
|
2022-01-24 20:04:31 +00:00
|
|
|
ci-check:
|
2021-04-16 02:41:54 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
2021-04-16 03:01:44 +00:00
|
|
|
|
2022-01-24 19:58:07 +00:00
|
|
|
- name: Install cppcheck
|
|
|
|
run: |
|
2022-01-24 20:04:31 +00:00
|
|
|
sudo apt-get install -y cppcheck
|
2022-01-24 19:58:07 +00:00
|
|
|
|
2021-04-16 05:46:14 +00:00
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.x
|
|
|
|
|
|
|
|
- name: Cache python libs
|
|
|
|
uses: actions/cache@v1
|
|
|
|
id: cache-pip # needed in if test
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip
|
|
|
|
|
2022-01-24 20:04:31 +00:00
|
|
|
- name: Upgrade python tools and install platformio
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install -U platformio
|
|
|
|
|
|
|
|
- name: Upgrade platformio
|
|
|
|
run: |
|
|
|
|
pio upgrade
|
|
|
|
|
|
|
|
- name: Check everything
|
|
|
|
run: bin/check-all.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ci-build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
|
|
|
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.x
|
|
|
|
|
|
|
|
- name: Cache python libs
|
|
|
|
uses: actions/cache@v1
|
|
|
|
id: cache-pip # needed in if test
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip
|
2021-05-03 07:51:33 +00:00
|
|
|
|
2021-04-16 05:46:14 +00:00
|
|
|
- name: Upgrade python tools
|
|
|
|
# We actually want to run this every time
|
|
|
|
# if: steps.cache-pip.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install -U platformio meshtastic adafruit-nrfutil
|
|
|
|
|
2021-05-03 07:46:13 +00:00
|
|
|
# - name: Cache platformio
|
|
|
|
# uses: actions/cache@v1
|
|
|
|
# id: cache-platformio # needed in if test
|
|
|
|
# with:
|
|
|
|
# path: ~/.platformio
|
|
|
|
# key: ${{ runner.os }}-platformio
|
2021-04-16 05:46:14 +00:00
|
|
|
|
|
|
|
- name: Upgrade platformio
|
|
|
|
run: |
|
|
|
|
pio upgrade
|
2021-04-16 01:39:10 +00:00
|
|
|
|
2021-10-09 06:15:12 +00:00
|
|
|
- name: Pull web ui
|
|
|
|
uses: dsaltares/fetch-gh-release-asset@master
|
|
|
|
with:
|
|
|
|
repo: "meshtastic/meshtastic-web"
|
|
|
|
file: "build.tar"
|
|
|
|
target: "build.tar"
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Unpack web ui
|
|
|
|
run: |
|
|
|
|
tar -xf build.tar -C data/static
|
|
|
|
rm build.tar
|
|
|
|
|
2021-04-16 04:23:09 +00:00
|
|
|
# We now run integration test before other build steps (to quickly see runtime failures)
|
2021-05-23 09:02:47 +00:00
|
|
|
- name: Build for native
|
|
|
|
run: platformio run -e native
|
|
|
|
- name: Integration test
|
|
|
|
run: |
|
|
|
|
.pio/build/native/program &
|
|
|
|
sleep 20 # 5 seconds was not enough
|
|
|
|
echo "Simulator started, launching python test..."
|
|
|
|
python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
|
2021-03-18 11:48:06 +00:00
|
|
|
|
2021-04-16 04:23:09 +00:00
|
|
|
# - name: Build for tbeam
|
|
|
|
# run: platformio run -e tbeam
|
|
|
|
# - name: Build for heltec
|
|
|
|
# run: platformio run -e heltec
|
|
|
|
# - name: Build for wisblock RAK4631
|
|
|
|
# run: platformio run -e rak4631
|
|
|
|
|
|
|
|
- name: Build everything
|
|
|
|
run: bin/build-all.sh
|
|
|
|
|
2021-05-26 02:21:26 +00:00
|
|
|
- name: Store binaries as an artifact
|
2021-04-16 04:23:09 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-04-16 04:46:21 +00:00
|
|
|
name: built
|
|
|
|
path: release/archive/firmware-*.zip
|
2021-04-16 05:37:00 +00:00
|
|
|
retention-days: 30
|
2021-05-26 02:21:26 +00:00
|
|
|
|
|
|
|
- name: Store debugging elf files as an artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: debug-elfs
|
|
|
|
path: release/archive/elfs-*.zip
|
|
|
|
retention-days: 7
|