meshtastic-firmware/.github/workflows/main_matrix.yml

498 wiersze
14 KiB
YAML
Czysty Zwykły widok Historia

2022-05-12 10:03:53 +00:00
name: CI
on:
# # Triggers the workflow on push but only for the master branch
push:
2022-03-09 13:04:49 +00:00
branches: [master]
paths-ignore:
2022-03-09 13:04:49 +00:00
- "**.md"
2022-08-12 12:04:36 +00:00
- "version.properties"
2022-03-09 13:04:49 +00:00
# Note: This is different from "pull_request". Need to specify ref when doing checkouts.
pull_request_target:
2022-03-09 13:04:49 +00:00
branches: [master]
paths-ignore:
2022-03-09 13:04:49 +00:00
- "**.md"
- "**.yml"
workflow_dispatch:
jobs:
check:
strategy:
fail-fast: false
matrix:
include:
- board: rak11200
- board: tlora-v2
- board: tlora-v1
- board: tlora_v1_3
- board: tlora-v2-1-1.6
- board: tbeam
- board: heltec-v1
- board: heltec-v2.0
- board: heltec-v2.1
- board: tbeam0.7
- board: meshtastic-diy-v1
- board: rak4631
- board: rak4631_eink
- board: t-echo
2022-04-27 17:23:20 +00:00
- board: nano-g1
2022-08-03 12:36:29 +00:00
- board: station-g1
2022-06-20 16:19:20 +00:00
- board: m5stack-core
- board: m5stack-coreink
2022-09-12 12:39:41 +00:00
- board: tbeam-s3-core
2022-08-10 21:28:11 +00:00
# - board: pico
2022-06-20 14:13:27 +00:00
runs-on: ubuntu-latest
steps:
2022-03-09 13:04:49 +00:00
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
2022-03-09 13:04:49 +00:00
- name: Install cppcheck
run: |
sudo apt-get install -y cppcheck
- 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
- 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 ${{ matrix.board }}
run: bin/check-all.sh ${{ matrix.board }}
build-esp32:
strategy:
fail-fast: false
matrix:
include:
- board: rak11200
- board: tlora-v2
- board: tlora-v1
- board: tlora_v1_3
- board: tlora-v2-1-1.6
- board: tbeam
- board: heltec-v1
- board: heltec-v2.0
- board: heltec-v2.1
- board: tbeam0.7
- board: meshtastic-diy-v1
2022-04-27 17:23:20 +00:00
- board: nano-g1
2022-08-03 12:36:29 +00:00
- board: station-g1
2022-06-20 16:19:20 +00:00
- board: m5stack-core
- board: m5stack-coreink
2022-09-12 12:39:41 +00:00
- board: tbeam-s3-core
2022-03-09 13:04:49 +00:00
runs-on: ubuntu-latest
steps:
2022-03-09 13:04:49 +00:00
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
2022-03-09 13:04:49 +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
- name: Upgrade python tools
run: |
python -m pip install --upgrade pip
2022-04-25 06:24:08 +00:00
pip install -U platformio adafruit-nrfutil littlefs-python
2022-03-09 13:04:49 +00:00
- name: Upgrade platformio
run: |
pio upgrade
- 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
- name: Build ESP32
run: bin/build-esp32.sh ${{ matrix.board }}
- name: Get release version string
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
id: version
- name: Store binaries as an artifact
uses: actions/upload-artifact@v2
with:
name: firmware-${{ matrix.board }}-${{ steps.version.outputs.version }}.zip
path: |
release/*.bin
release/*.elf
retention-days: 90
build-nrf52:
strategy:
fail-fast: false
max-parallel: 2
matrix:
2022-03-09 13:04:49 +00:00
include:
- board: rak4631
- board: rak4631_eink
- board: t-echo
2022-04-06 16:04:11 +00:00
- board: pca10059_diy_eink
2022-03-09 13:04:49 +00:00
runs-on: ubuntu-latest
steps:
2022-03-09 13:04:49 +00:00
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- 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-03-09 13:04:49 +00:00
- name: Upgrade python tools
run: |
python -m pip install --upgrade pip
2022-04-25 06:48:04 +00:00
pip install -U platformio adafruit-nrfutil
2022-03-09 13:04:49 +00:00
- name: Upgrade platformio
run: |
pio upgrade
- name: Build NRF52
run: bin/build-nrf52.sh ${{ matrix.board }}
- name: Get release version string
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
id: version
- name: Store binaries as an artifact
uses: actions/upload-artifact@v2
with:
name: firmware-${{ matrix.board }}-${{ steps.version.outputs.version }}.zip
path: |
release/*.uf2
release/*.elf
retention-days: 90
build-rpi2040:
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- board: pico
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- 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
- name: Upgrade python tools
run: |
python -m pip install --upgrade pip
pip install -U platformio adafruit-nrfutil
- name: Upgrade platformio
run: |
pio upgrade
- name: Build Raspberry Pi 2040
2022-08-10 21:10:03 +00:00
run: ./bin/build-rpi2040.sh ${{ matrix.board }}
- name: Get release version string
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
id: version
- name: Store binaries as an artifact
uses: actions/upload-artifact@v2
with:
name: firmware-${{ matrix.board }}-${{ steps.version.outputs.version }}.zip
path: |
release/*.uf2
release/*.elf
retention-days: 90
build-native:
runs-on: ubuntu-latest
steps:
2022-03-09 13:04:49 +00:00
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: "recursive"
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- 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
- name: Upgrade python tools
run: |
python -m pip install --upgrade pip
2022-04-25 06:48:04 +00:00
pip install -U platformio adafruit-nrfutil
2022-09-18 01:03:11 +00:00
pip install -U meshtastic --pre
2022-03-09 13:04:49 +00:00
- name: Upgrade platformio
run: |
pio upgrade
# We now run integration test before other build steps (to quickly see runtime failures)
- 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()'
- name: Build Native
run: bin/build-native.sh
- name: Get release version string
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
id: version
- name: Store binaries as an artifact
uses: actions/upload-artifact@v2
with:
name: firmware-native-${{ steps.version.outputs.version }}.zip
path: |
release/meshtasticd_linux_amd64
release/device-*.sh
release/device-*.bat
retention-days: 90
2022-02-14 17:27:33 +00:00
after-checks:
runs-on: ubuntu-latest
needs: [check]
steps:
- name: Checkout code
2022-03-09 13:04:49 +00:00
uses: actions/checkout@v3
2022-02-14 17:27:33 +00:00
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
2022-08-10 23:00:41 +00:00
gather-artifacts:
runs-on: ubuntu-latest
needs: [build-esp32, build-nrf52, build-native, build-rpi2040]
steps:
- name: Checkout code
2022-03-09 13:04:49 +00:00
uses: actions/checkout@v3
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: actions/download-artifact@v2
with:
path: ./
- name: Get release version string
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
id: version
- name: Move files up
2022-09-26 20:48:02 +00:00
run: mv -b -t ./ ./*tbeam-1*/littlefs*.bin ./*tbeam-1*/system-info.bin ./*tbeam-1*/partitions.bin ./**/firmware*.bin ./**/*.uf2 ./**/*.elf ./**/meshtasticd_linux_amd64 ./*native*/*device-*.sh ./*native*/*device-*.bat
- name: Repackage in single firmware zip
uses: actions/upload-artifact@v2
with:
name: firmware-${{ steps.version.outputs.version }}
2022-03-09 13:04:49 +00:00
path: |
./*.bin
./*.uf2
./meshtasticd_linux_amd64
./device-*.sh
./device-*.bat
retention-days: 90
- uses: actions/download-artifact@v2
with:
name: firmware-${{ steps.version.outputs.version }}
path: ./output
# For diagnostics
2022-03-09 13:04:49 +00:00
- name: Show artifacts
run: ls -lR
2022-08-20 17:53:34 +00:00
- name: Device scripts permissions
run: |
chmod +x ./output/device-install.sh
chmod +x ./output/device-update.sh
- name: Zip firmware
run: zip -j -r ./firmware-${{ steps.version.outputs.version }}.zip ./output
- name: Repackage in single elfs zip
uses: actions/upload-artifact@v2
with:
name: debug-elfs-${{ steps.version.outputs.version }}.zip
path: ./*.elf
retention-days: 90
- name: Create request artifacts
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }}
uses: gavv/pull-request-artifacts@v1.0.0
with:
commit: ${{ (github.event.pull_request_target || github.event.pull_request).head.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
2022-03-06 14:50:42 +00:00
artifacts-token: ${{ secrets.ARTIFACTS_TOKEN }}
artifacts-repo: meshtastic/artifacts
artifacts-branch: device
artifacts-dir: pr
artifacts: ./firmware-${{ steps.version.outputs.version }}.zip
2022-08-10 22:59:47 +00:00
release-artifacts:
runs-on: ubuntu-latest
2022-08-11 20:58:16 +00:00
if: ${{ github.event_name == 'workflow_dispatch' }}
2022-08-12 00:23:51 +00:00
needs: [gather-artifacts, after-checks]
steps:
2022-08-11 20:58:16 +00:00
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
2022-08-11 20:58:16 +00:00
python-version: 3.x
- name: Get release version string
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
id: version
- uses: actions/download-artifact@v2
with:
name: firmware-${{ steps.version.outputs.version }}
path: ./output
2022-08-14 20:56:55 +00:00
- name: Device scripts permissions
run: |
chmod +x ./output/device-install.sh
chmod +x ./output/device-update.sh
- name: Zip firmware
run: zip -j -r ./firmware-${{ steps.version.outputs.version }}.zip ./output
- uses: actions/download-artifact@v2
2022-08-10 22:59:47 +00:00
with:
name: debug-elfs-${{ steps.version.outputs.version }}.zip
path: ./elfs
- name: Zip Elfs
run: zip -j -r ./debug-elfs-${{ steps.version.outputs.version }}.zip ./elfs
# For diagnostics
- name: Show artifacts
run: ls -lR
2022-08-10 22:59:47 +00:00
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: true
2022-08-11 12:07:04 +00:00
release_name: Meshtastic Device ${{ steps.version.outputs.version }} alpha - Public Preview
2022-08-10 22:59:47 +00:00
tag_name: v${{ steps.version.outputs.version }}
body: |
Autogenerated by github action, developer should edit as required before publishing...
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Add bins to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
2022-08-11 00:21:59 +00:00
asset_path: ./firmware-${{ steps.version.outputs.version }}.zip
2022-08-10 22:59:47 +00:00
asset_name: firmware-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
2022-08-11 00:25:27 +00:00
- name: Add debug elfs to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
2022-08-11 12:07:04 +00:00
asset_path: ./debug-elfs-${{ steps.version.outputs.version }}.zip
2022-08-11 00:25:27 +00:00
asset_name: debug-elfs-${{ steps.version.outputs.version }}.zip
2022-08-11 14:03:18 +00:00
asset_content_type: application/zip
2022-08-11 20:58:16 +00:00
2022-08-12 12:21:20 +00:00
- name: Bump version.properties
2022-08-11 20:58:16 +00:00
run: >-
bin/bump_version.py
2022-08-22 23:31:56 +00:00
- name: Create version.properties pull request
uses: peter-evans/create-pull-request@v3
with:
add-paths: |
version.properties
2022-08-11 20:58:16 +00:00