firmware/.github/workflows/main_matrix.yml

401 lines
12 KiB
YAML
Raw Normal View History

2022-05-12 10:03:53 +00:00
name: CI
#concurrency:
# group: ${{ github.ref }}
# cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
on:
# # Triggers the workflow on push but only for the master branch
push:
2022-11-05 14:21:51 +00:00
branches: [master, develop]
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-11-05 14:21:51 +00:00
branches: [master, develop]
paths-ignore:
2022-03-09 13:04:49 +00:00
- "**.md"
2022-10-05 16:18:37 +00:00
#- "**.yml"
workflow_dispatch:
jobs:
check:
strategy:
fail-fast: false
matrix:
include:
- board: rak11200
2023-05-08 18:33:34 +00:00
- board: tlora-v2-1-1_6
- board: tbeam
2023-05-08 18:33:34 +00:00
- board: heltec-v2_1
- board: meshtastic-diy-v1
- board: rak4631
- board: t-echo
2022-08-03 12:36:29 +00:00
- board: station-g1
2022-06-20 16:19:20 +00:00
- board: m5stack-coreink
2022-09-12 12:39:41 +00:00
- board: tbeam-s3-core
2022-12-28 15:20:23 +00:00
- board: tlora-t3s3-v1
- board: t-watch-s3
- board: t-deck
#- board: rak11310
runs-on: ubuntu-latest
steps:
2022-11-20 01:23:35 +00:00
- uses: actions/checkout@v3
- name: Build base
id: base
uses: ./.github/actions/setup-base
2022-03-09 13:04:49 +00:00
- name: Trunk Check
2023-04-04 14:42:12 +00:00
if: ${{ github.event_name != 'workflow_dispatch' }}
2023-07-27 12:59:39 +00:00
uses: trunk-io/trunk-action@782e83f803ca6e369f035d64c6ba2768174ba61b
2022-03-09 13:04:49 +00:00
- 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
2023-05-08 18:33:34 +00:00
- board: tlora-v2-1-1_6
- board: tlora-v2-1-1_8
- board: tbeam
2023-12-10 01:12:51 +00:00
- board: heltec-ht62-esp32c3-sx1262
- board: heltec-v1
2023-05-08 18:33:34 +00:00
- board: heltec-v2_0
- board: heltec-v2_1
- board: tbeam0_7
- board: meshtastic-diy-v1
- board: hydra
- board: meshtastic-dr-dev
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
2023-02-20 22:23:02 +00:00
- board: nano-g1-explorer
2022-11-19 23:35:47 +00:00
uses: ./.github/workflows/build_esp32.yml
2022-11-19 23:45:33 +00:00
with:
board: ${{ matrix.board }}
2023-03-09 07:44:39 +00:00
build-esp32-s3:
strategy:
fail-fast: false
matrix:
include:
- board: heltec-v3
- board: heltec-wsl-v3
- board: heltec-wireless-tracker
- board: heltec-wireless-paper
2023-03-09 07:44:39 +00:00
- board: tbeam-s3-core
- board: tlora-t3s3-v1
- board: t-watch-s3
- board: t-deck
2023-08-07 19:34:01 +00:00
- board: picomputer-s3
2023-03-09 07:44:39 +00:00
uses: ./.github/workflows/build_esp32_s3.yml
with:
board: ${{ matrix.board }}
2023-03-09 08:04:08 +00:00
build-nrf52:
strategy:
fail-fast: false
matrix:
2022-03-09 13:04:49 +00:00
include:
- board: rak4631
- board: rak4631_eink
- board: monteops_hw1
- board: t-echo
2022-04-06 16:04:11 +00:00
- board: pca10059_diy_eink
- board: feather_diy
2023-07-30 19:07:17 +00:00
- board: nano-g2-ultra
2022-11-20 01:30:19 +00:00
uses: ./.github/workflows/build_nrf52.yml
with:
board: ${{ matrix.board }}
build-rpi2040:
strategy:
fail-fast: false
matrix:
include:
- board: pico
- board: picow
- board: rak11310
- board: senselora_rp2040
uses: ./.github/workflows/build_rpi2040.yml
with:
board: ${{ matrix.board }}
2023-11-18 14:55:19 +00:00
build-raspbian:
strategy:
fail-fast: false
max-parallel: 1
uses: ./.github/workflows/build_raspbian.yml
2023-11-19 22:41:47 +00:00
package-raspbian:
uses: ./.github/workflows/package_raspbian.yml
build-native:
runs-on: ubuntu-latest
steps:
2022-11-20 01:23:35 +00:00
- uses: actions/checkout@v3
- name: Build base
id: base
uses: ./.github/actions/setup-base
2022-03-09 13:04:49 +00:00
# We now run integration test before other build steps (to quickly see runtime failures)
2023-01-18 22:18:01 +00:00
#- name: Build for native
# run: platformio run -e native
#- name: Integration test
2023-01-18 22:34:21 +00:00
# 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()'
2022-03-09 13:04:49 +00:00
- name: Build Native
run: bin/build-native.sh
- name: Get release version string
2022-10-19 15:44:09 +00:00
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
2022-03-09 13:04:49 +00:00
id: version
- name: Store binaries as an artifact
2022-10-19 13:11:28 +00:00
uses: actions/upload-artifact@v3
2022-03-09 13:04:49 +00:00
with:
name: firmware-native-${{ steps.version.outputs.version }}.zip
path: |
release/device-*.sh
release/device-*.bat
2022-11-19 21:44:59 +00:00
- name: Docker login
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
2022-11-19 21:44:59 +00:00
uses: docker/login-action@v2
with:
2022-11-19 21:44:59 +00:00
username: meshtastic
password: ${{ secrets.DOCKER_TOKEN }}
- name: Docker setup
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
2022-11-19 21:44:59 +00:00
uses: docker/setup-buildx-action@v2
2023-01-22 19:52:01 +00:00
- name: Docker build and push tagged versions
2022-11-20 13:05:49 +00:00
if: ${{ github.event_name == 'workflow_dispatch' }}
2022-11-19 21:44:59 +00:00
uses: docker/build-push-action@v3
2023-01-22 19:52:01 +00:00
with:
context: .
file: ./Dockerfile
push: true
tags: meshtastic/device-simulator:${{ steps.version.outputs.version }}
- name: Docker build and push
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
2023-01-22 19:52:01 +00:00
uses: docker/build-push-action@v3
2022-11-19 21:44:59 +00:00
with:
context: .
file: ./Dockerfile
push: true
2022-11-20 13:05:49 +00:00
tags: meshtastic/device-simulator:latest
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:
2023-12-08 03:22:30 +00:00
permissions:
2023-12-08 03:29:04 +00:00
contents: write
pull-requests: write
runs-on: ubuntu-latest
needs:
[
build-esp32,
build-esp32-s3,
build-nrf52,
build-raspbian,
build-native,
build-rpi2040,
2023-11-19 22:41:47 +00:00
package-raspbian,
]
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}}
2022-10-19 16:35:25 +00:00
- uses: actions/download-artifact@v3
with:
path: ./
2023-11-18 21:16:36 +00:00
- name: Display structure of downloaded files
run: ls -R
- name: Get release version string
2022-10-19 15:44:09 +00:00
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
id: version
- name: Move files up
run: mv -b -t ./ ./*tbeam-2*/littlefs*.bin ./*tbeam-2*/bleota.bin ./*tbeam-s3*/bleota-s3.bin ./**/firmware*.bin ./*t-echo*/Meshtastic_nRF52_factory_erase.uf2 ./**/firmware-*.uf2 ./**/firmware-*-ota.zip ./**/*.elf ./*native*/*device-*.sh ./*native*/*device-*.bat ./firmware-raspbian-*/release/meshtasticd_linux_arm64 ./firmware-raspbian-*/bin/config-dist.yaml
- name: Repackage in single firmware zip
2022-10-19 13:11:28 +00:00
uses: actions/upload-artifact@v3
with:
name: firmware-${{ steps.version.outputs.version }}
2022-03-09 13:04:49 +00:00
path: |
./*.bin
./*.uf2
./firmware-*-ota.zip
./device-*.sh
./device-*.bat
2023-11-19 23:11:54 +00:00
./meshtasticd_linux_arm64
./config-dist.yaml
retention-days: 90
2022-10-19 16:35:25 +00:00
- uses: actions/download-artifact@v3
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-10-31 08:47:10 +00:00
2022-08-20 17:53:34 +00:00
- name: Device scripts permissions
run: |
chmod +x ./output/device-install.sh
2023-07-24 12:22:04 +00:00
chmod +x ./output/device-update.sh
- name: Zip firmware
2022-11-24 12:07:37 +00:00
run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output
- name: Repackage in single elfs zip
2022-10-19 13:11:28 +00:00
uses: actions/upload-artifact@v3
with:
name: debug-elfs-${{ steps.version.outputs.version }}.zip
path: ./*.elf
2022-11-09 13:20:53 +00:00
retention-days: 30
- name: Create request artifacts
2023-07-24 11:54:05 +00:00
continue-on-error: true # FIXME: Why are we getting 502, but things still work?
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }}
2023-12-08 02:22:22 +00:00
uses: gavv/pull-request-artifacts@v2.1.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: ./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@v3
2022-10-31 08:47:10 +00:00
2022-08-11 20:58:16 +00:00
- name: Setup Python
2022-10-19 13:51:00 +00:00
uses: actions/setup-python@v4
with:
2022-08-11 20:58:16 +00:00
python-version: 3.x
- name: Get release version string
2022-10-19 15:44:09 +00:00
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
2022-08-11 20:58:16 +00:00
id: version
2022-10-19 16:35:25 +00:00
- uses: actions/download-artifact@v3
with:
name: firmware-${{ steps.version.outputs.version }}
path: ./output
2023-11-19 23:11:54 +00:00
2023-11-19 22:41:47 +00:00
- uses: actions/download-artifact@v3
with:
name: artifact-deb
2022-10-31 08:47:10 +00:00
2023-11-18 20:56:40 +00:00
- name: Display structure of downloaded files
run: ls -R
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
2022-11-24 12:07:37 +00:00
run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output
2022-10-19 16:35:25 +00:00
- uses: actions/download-artifact@v3
2022-08-10 22:59:47 +00:00
with:
name: debug-elfs-${{ steps.version.outputs.version }}.zip
path: ./elfs
2022-10-31 08:47:10 +00:00
- name: Zip Elfs
2022-11-24 12:07:37 +00:00
run: zip -j -9 -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
2023-07-09 11:17:17 +00:00
release_name: Meshtastic Firmware ${{ steps.version.outputs.version }} Alpha
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
2023-11-19 22:41:47 +00:00
- name: Add raspbian .deb
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./meshtasticd_${{ steps.version.outputs.version }}_arm64.deb
asset_name: meshtasticd_${{ steps.version.outputs.version }}_arm64.deb
asset_content_type: application/vnd.debian.binary-package
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-10-31 08:47:10 +00:00
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