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

Update docker.txt #19

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
name: Continuous Integration
name: Continuous Integration (Legacy serial build)
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
paths-ignore:
- '**.md'
- '**.yml'
- 'version.properties'

# Note: This is different from "pull_request". Need to specify ref when doing checkouts.
pull_request_target:
branches: [ master ]
paths-ignore:
- '**.md'
- '**.yml'

workflow_dispatch:

jobs:

ci-check:
Expand Down
281 changes: 281 additions & 0 deletions .github/workflows/main_matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
name: Continuous Integration
on:
# # Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
paths-ignore:
- '**.md'
- '**.yml'
- 'version.properties'

# Note: This is different from "pull_request". Need to specify ref when doing checkouts.
pull_request_target:
branches: [ master ]
paths-ignore:
- '**.md'
- '**.yml'

jobs:

ci-check:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- 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 everything
run: bin/check-all.sh

ci-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

runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v2
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 meshtastic adafruit-nrfutil

- 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

# 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 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: ${{ matrix.board }}-firmware-${{ steps.version.outputs.version }}.zip
path: release/archive/firmware-${{ steps.version.outputs.version }}.zip
retention-days: 90

- name: Store debugging elf files as an artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.board }}-debug-elfs
path: release/archive/elfs-*.zip
retention-days: 7

ci-build-nrf52:
strategy:
fail-fast: false
matrix:
include:
- board: rak4631_5005
- board: rak4631_19003
- board: t-echo

runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v2
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 meshtastic adafruit-nrfutil

- 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: ${{ matrix.board }}-firmware-${{ steps.version.outputs.version }}.zip
path: release/archive/firmware-${{ steps.version.outputs.version }}.zip
retention-days: 90

- name: Store debugging elf files as an artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.board }}-debug-elfs
path: release/archive/elfs-*.zip
retention-days: 7

ci-build-native:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v2
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 meshtastic adafruit-nrfutil

- name: Upgrade platformio
run: |
pio upgrade

- 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: ${{ matrix.board }}-firmware-${{ steps.version.outputs.version }}.zip
path: release/archive/firmware-${{ steps.version.outputs.version }}.zip
retention-days: 90

gather-artifacts:
needs: [ci-build-esp32, ci-build-nrf52, ci-build-native]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

# - name: Download firmware.zip
# uses: actions/download-artifact@master
# with:
# name: firmware-${{ steps.version.outputs.version }}.zip
# path: ./

# - name: Pull request artifacts
# if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }}
# uses: gavv/[email protected]
# with:
# commit: ${{ (github.event.pull_request_target || github.event.pull_request).head.sha }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# artifacts-branch: artifacts
# artifacts: ./firmware-${{ steps.version.outputs.version }}.zip
63 changes: 0 additions & 63 deletions bin/build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ set -e
VERSION=`bin/buildinfo.py long`
SHORT_VERSION=`bin/buildinfo.py short`

BOARDS_ESP32="rak11200 tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1"
#BOARDS_ESP32=tbeam

# FIXME note nrf52840dk build is for some reason only generating a BIN file but not a HEX file nrf52840dk-geeksville is fine
BOARDS_NRF52="rak4631_5005 rak4631_19003 t-echo"
#BOARDS_NRF52=""

OUTDIR=release/latest

# We keep all old builds (and their map files in the archive dir)
Expand All @@ -23,71 +16,15 @@ mkdir -p $OUTDIR/bins $ARCHIVEDIR
rm -r $OUTDIR/bins/* || true
mkdir -p $OUTDIR/bins/universal $OUTDIR/elfs/universal

# build the named environment and copy the bins to the release directory
function do_build() {
BOARD=$1
isNrf=$3

echo "Building for $BOARD ($isNrf) with $PLATFORMIO_BUILD_FLAGS"
rm -f .pio/build/$BOARD/firmware.*

# The shell vars the build tool expects to find
export APP_VERSION=$VERSION

# Are we building a universal/regionless rom?
export HW_VERSION="1.0"
basename=universal/firmware-$BOARD-$VERSION

pio run --environment $BOARD # -v
SRCELF=.pio/build/$BOARD/firmware.elf
cp $SRCELF $OUTDIR/elfs/$basename.elf

if [ "$isNrf" = "false" ]
then
echo "Copying ESP32 bin file"
SRCBIN=.pio/build/$BOARD/firmware.bin
cp $SRCBIN $OUTDIR/bins/$basename.bin
else
echo "Generating NRF52 uf2 file"
SRCHEX=.pio/build/$BOARD/firmware.hex
bin/uf2conv.py $SRCHEX -c -o $OUTDIR/bins/$basename.uf2 -f 0xADA52840
fi
}

function do_boards() {
declare boards=$1
declare isNrf=$2
for board in $boards; do
# Build universal
echo "about to build $board $isNrf"
do_build $board "" "$isNrf"
done
}

# Make sure our submodules are current
git submodule update

# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio lib update

do_boards "$BOARDS_ESP32" "false"
do_boards "$BOARDS_NRF52" "true"

pio run --environment native
cp .pio/build/native/program $OUTDIR/bins/universal/meshtasticd_linux_amd64

echo "Building SPIFFS for ESP32 targets"
pio run --environment tbeam -t buildfs
cp .pio/build/tbeam/spiffs.bin $OUTDIR/bins/universal/spiffs-$VERSION.bin

# keep the bins in archive also
cp $OUTDIR/bins/universal/spiffs* $OUTDIR/bins/universal/firmware* $OUTDIR/elfs/universal/firmware* $ARCHIVEDIR

echo Updating android bins $OUTDIR/forandroid
rm -rf $OUTDIR/forandroid
mkdir -p $OUTDIR/forandroid
cp -a $OUTDIR/bins/universal/*.bin $OUTDIR/forandroid/

cat >$OUTDIR/curfirmwareversion.xml <<XML
<?xml version="1.0" encoding="utf-8"?>

Expand Down
Loading