feat: WASM modules based simulation in Companion (#6435)
This commit is contained in:
@@ -15,9 +15,6 @@ on:
|
||||
- '.gitmodules'
|
||||
- 'CMakeLists.txt'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
- '[0-9]+.[0-9]+'
|
||||
paths: *trigger-paths
|
||||
|
||||
jobs:
|
||||
@@ -30,7 +27,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- x9dp2019
|
||||
- x9dp2019;x9e
|
||||
- tx15
|
||||
- tx16s
|
||||
- tx16smk3
|
||||
@@ -38,20 +35,14 @@ jobs:
|
||||
- el18
|
||||
- pl18
|
||||
- pl18ev
|
||||
- t12max
|
||||
- t12max;t14
|
||||
- t15
|
||||
- t16
|
||||
- t18
|
||||
- tlite #STM32F2
|
||||
- t20
|
||||
- t14
|
||||
- t20v2
|
||||
- tx12 #STM32F2
|
||||
- t20;t20v2
|
||||
- x10
|
||||
- x12s
|
||||
- x9e
|
||||
- mt12
|
||||
- gx12
|
||||
- mt12;gx12
|
||||
- nb4p
|
||||
- st16
|
||||
- t15pro
|
||||
@@ -65,7 +56,6 @@ jobs:
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
# fetch-depth: 0 # https://github.com/actions/checkout#Fetch-all-history-for-all-tags-and-branches
|
||||
|
||||
- name: Test ${{ matrix.target }}
|
||||
env:
|
||||
@@ -86,28 +76,21 @@ jobs:
|
||||
matrix:
|
||||
target:
|
||||
- nv14;el18
|
||||
- pl18;pl18ev;pl18u
|
||||
- pa01
|
||||
- t12max
|
||||
- t15;t16;t18
|
||||
- zorro;pocket;mt12;commando8
|
||||
- pl18;pl18ev
|
||||
- pl18u;pa01
|
||||
- t15;t16
|
||||
- t14;t18;mt12
|
||||
- zorro;pocket;commando8
|
||||
- tprov2;tpros;bumblebee
|
||||
- t20;t20v2;t14
|
||||
- tx12mk2;boxer;gx12
|
||||
- tx15
|
||||
- tx16s
|
||||
- tx16smk3
|
||||
- f16
|
||||
- mt12;gx12;t20;t20v2
|
||||
- t12max;tx12mk2;boxer
|
||||
- tx15;tx16s
|
||||
- x12s;f16
|
||||
- v12;v14;v16
|
||||
- x10;x10express
|
||||
- x12s
|
||||
- x7access
|
||||
- x9dp2019
|
||||
- x9e;x9e-hall
|
||||
- mt12;gx12
|
||||
- nb4p
|
||||
- st16
|
||||
- t15pro
|
||||
- x7access;x9dp2019;x9e;x9e-hall
|
||||
- nb4p;st16
|
||||
- tx16smk3;t14;t15pro
|
||||
container:
|
||||
image: ghcr.io/edgetx/edgetx-dev:latest
|
||||
volumes:
|
||||
@@ -144,7 +127,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Compose release filename
|
||||
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
||||
run: echo "artifact_name=edgetx-firmware-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Merge firmware artifact packages
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
name: Companion
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
tags:
|
||||
- v*
|
||||
paths:
|
||||
- '.github/workflows/companion.yml'
|
||||
- 'companion/**'
|
||||
- 'tools/build-companion.sh'
|
||||
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/companion.yml'
|
||||
- 'companion/**'
|
||||
- 'tools/build-companion.sh'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
modules:
|
||||
name: WASM Modules (${{ matrix.group.id }})
|
||||
runs-on: macos-15
|
||||
strategy:
|
||||
matrix:
|
||||
group:
|
||||
- id: color-1
|
||||
target: [nv14, el18, pl18, pl18ev]
|
||||
- id: color-2
|
||||
target: [pl18u, t15, t16, t18]
|
||||
- id: bw-1
|
||||
target: [zorro, pocket, mt12, commando8, tprov2, tpros, bumblebee, t14]
|
||||
- id: bw-2
|
||||
target: [mt12, gx12, t20, t20v2, t12max, tx12mk2, boxer]
|
||||
- id: color-3
|
||||
target: [tx15, tx16s, x12s, f16]
|
||||
- id: mixed-1
|
||||
target: [v12, v14, v16, x10, x10express]
|
||||
- id: bw-3
|
||||
target: [x7access, x9dp2019, x9e, x9e-hall]
|
||||
- id: color-4
|
||||
target: [nb4p, st16, pa01]
|
||||
- id: color-5
|
||||
target: [t15pro, tx16smk3]
|
||||
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Setup Python Dependencies
|
||||
uses: ./.github/actions/python_dependencies
|
||||
|
||||
- name: Setup WASI SDK
|
||||
uses: ./.github/actions/wasi_sdk
|
||||
|
||||
- name: Build modules
|
||||
shell: bash
|
||||
env:
|
||||
FLAVOR: ${{ join(matrix.group.target, ';') }}
|
||||
CMAKE_BUILD_TYPE: 'Release'
|
||||
run: |
|
||||
mkdir output && \
|
||||
tools/build-wasm-modules.sh "$(pwd)" "$(pwd)/output/"
|
||||
|
||||
- name: Archive production artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: wasm-modules-${{ matrix.group.id }}
|
||||
path: ${{github.workspace}}/output
|
||||
if-no-files-found: error
|
||||
retention-days: 15
|
||||
|
||||
build-linux:
|
||||
name: Linux Companion
|
||||
runs-on: ubuntu-latest
|
||||
needs: modules
|
||||
|
||||
container:
|
||||
image: ghcr.io/edgetx/edgetx-dev:latest
|
||||
volumes:
|
||||
- ${{ github.workspace }}:/src
|
||||
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Download WASM modules
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
pattern: wasm-modules-*
|
||||
path: wasm-modules
|
||||
merge-multiple: true
|
||||
|
||||
- name: Setup and Build
|
||||
uses: ./.github/actions/build_companion
|
||||
with:
|
||||
os: 'linux'
|
||||
|
||||
build-macos:
|
||||
name: macOS Companion
|
||||
runs-on: macos-15
|
||||
needs: modules
|
||||
|
||||
env:
|
||||
CMAKE_OSX_ARCHITECTURES: 'x86_64;arm64'
|
||||
CMAKE_OSX_DEPLOYMENT_TARGET: '11.0'
|
||||
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Download WASM modules
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
pattern: wasm-modules-*
|
||||
path: wasm-modules
|
||||
merge-multiple: true
|
||||
|
||||
- name: Setup and Build
|
||||
uses: ./.github/actions/build_companion
|
||||
with:
|
||||
os: 'macos'
|
||||
qt-arch: 'clang_64'
|
||||
|
||||
build-win64:
|
||||
name: Windows Companion
|
||||
runs-on: windows-2022
|
||||
needs: modules
|
||||
|
||||
env:
|
||||
CMAKE_GENERATOR: 'Ninja'
|
||||
CXX: 'clang++'
|
||||
CC: 'clang'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Download WASM modules
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
pattern: wasm-modules-*
|
||||
path: wasm-modules
|
||||
merge-multiple: true
|
||||
|
||||
- name: Setup and Build
|
||||
uses: ./.github/actions/build_companion
|
||||
with:
|
||||
os: 'win64'
|
||||
qt-arch: 'win64_msvc2022_64'
|
||||
@@ -1,86 +0,0 @@
|
||||
name: Linux Companion
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- '[0-9]+.[0-9]+'
|
||||
tags:
|
||||
- v*
|
||||
paths: &trigger-paths
|
||||
- '.github/workflows/linux_cpn.yml'
|
||||
- 'companion/**'
|
||||
- 'tools/build-companion.sh'
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
- '[0-9]+.[0-9]+'
|
||||
paths: *trigger-paths
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: Release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
github.event_name != 'pull_request' ||
|
||||
!contains(github.event.pull_request.labels.*.name, 'ci: skip-cpn-linux')
|
||||
container:
|
||||
image: ghcr.io/edgetx/edgetx-dev:latest
|
||||
volumes:
|
||||
- ${{ github.workspace }}:/src
|
||||
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
shell: bash
|
||||
env:
|
||||
CMAKE_BUILD_PARALLEL_LEVEL: 4
|
||||
run: |
|
||||
mkdir output && mkdir logs && \
|
||||
tools/build-companion.sh "$(pwd)" "$(pwd)/output/" 2>&1 | tee logs/build-main.log
|
||||
|
||||
- name: Collect build logs
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
# Create logs directory if it doesn't exist
|
||||
mkdir -p logs
|
||||
|
||||
# Copy all build logs from the build directory
|
||||
if [ -d "build" ]; then
|
||||
find build -name "*.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||
find build -name "CMakeOutput.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||
find build -name "CMakeError.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||
fi
|
||||
|
||||
- name: Compose release filename
|
||||
if: always()
|
||||
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
||||
run: echo "artifact_name=edgetx-cpn-linux-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Archive production artifacts
|
||||
if: success()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: "${{ env.artifact_name }}"
|
||||
path: ${{github.workspace}}/output
|
||||
retention-days: 15
|
||||
|
||||
- name: Archive build logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: "${{ env.artifact_name }}-logs"
|
||||
path: ${{github.workspace}}/logs
|
||||
retention-days: 30
|
||||
@@ -1,114 +0,0 @@
|
||||
name: MacOSX Companion
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- '[0-9]+.[0-9]+'
|
||||
tags:
|
||||
- v*
|
||||
paths: &trigger-paths
|
||||
- '.github/workflows/macosx_cpn.yml'
|
||||
- 'companion/**'
|
||||
- 'tools/build-companion.sh'
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
- '[0-9]+.[0-9]+'
|
||||
paths: *trigger-paths
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: Release
|
||||
QT_VERSION: "6.9.3"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-15-intel
|
||||
if: |
|
||||
github.event_name != 'pull_request' ||
|
||||
!contains(github.event.pull_request.labels.*.name, 'ci: skip-cpn-macos')
|
||||
steps:
|
||||
- name: Select XCode version
|
||||
uses: maxim-lobanov/setup-xcode@v1
|
||||
with:
|
||||
xcode-version: '16.0'
|
||||
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup Python 3.12
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Create Build Environment
|
||||
# Some projects don't allow in-source building, so create a separate build directory
|
||||
# We'll use this as our working directory for all subsequent commands
|
||||
run: cmake -E make_directory ${{github.workspace}}/build
|
||||
|
||||
- name: Install Qt
|
||||
uses: jdpurcell/install-qt-action@v5
|
||||
env:
|
||||
AQT_CONFIG: ${{ github.workspace }}/tools/aqt-settings.ini
|
||||
with:
|
||||
version: ${{ env.QT_VERSION }}
|
||||
modules: 'qtmultimedia qtserialport'
|
||||
setup-python: 'false'
|
||||
cache: true
|
||||
cache-key-prefix: 'install-qt-action-macOS'
|
||||
|
||||
- name: Install dependencies
|
||||
run: python3 -m pip install --upgrade pip Pillow lz4 clang jinja2 pydantic
|
||||
|
||||
- name: Install SDL2
|
||||
run: brew install SDL2
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}
|
||||
shell: bash
|
||||
env:
|
||||
CMAKE_BUILD_PARALLEL_LEVEL: 3
|
||||
run: |
|
||||
mkdir output && mkdir logs && \
|
||||
tools/build-companion.sh "$(pwd)" "$(pwd)/output/" 2>&1 | tee logs/build-main.log
|
||||
|
||||
- name: Collect build logs
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
# Create logs directory if it doesn't exist
|
||||
mkdir -p logs
|
||||
|
||||
# Copy all build logs from the build directory
|
||||
if [ -d "build" ]; then
|
||||
find build -name "*.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||
find build -name "CMakeOutput.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||
find build -name "CMakeError.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||
fi
|
||||
|
||||
- name: Compose release filename
|
||||
if: always()
|
||||
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
||||
run: echo "artifact_name=edgetx-cpn-osx-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Archive production artifacts
|
||||
if: success()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: "${{ env.artifact_name }}"
|
||||
path: ${{github.workspace}}/output
|
||||
retention-days: 15
|
||||
|
||||
- name: Archive build logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: "${{ env.artifact_name }}-logs"
|
||||
path: ${{github.workspace}}/logs
|
||||
retention-days: 30
|
||||
@@ -1,116 +0,0 @@
|
||||
name: Windows Companion 64-bit
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- '[0-9]+.[0-9]+'
|
||||
tags:
|
||||
- v*
|
||||
paths: &trigger-paths
|
||||
- '.github/workflows/win_cpn-64.yml'
|
||||
- 'companion/**'
|
||||
- 'tools/build-companion.sh'
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
- '[0-9]+.[0-9]+'
|
||||
paths: *trigger-paths
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
CMAKE_BUILD_TYPE: "Release"
|
||||
CMAKE_GENERATOR: "Ninja"
|
||||
QT_VERSION: "6.9.0"
|
||||
QT_ARCH: "win64_msvc2022_64"
|
||||
SDL_VERSION: "2.32.8"
|
||||
CXX: "clang++"
|
||||
CC: "clang"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
if: |
|
||||
github.event_name != 'pull_request' ||
|
||||
!contains(github.event.pull_request.labels.*.name, 'ci: skip-cpn-win')
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Qt
|
||||
uses: jdpurcell/install-qt-action@v5
|
||||
env:
|
||||
AQT_CONFIG: ${{ github.workspace }}/tools/aqt-settings.ini
|
||||
with:
|
||||
cache: true
|
||||
cache-key-prefix: 'install-qt-action-${{ env.QT_ARCH }}'
|
||||
version: ${{ env.QT_VERSION }}
|
||||
arch: ${{ env.QT_ARCH }}
|
||||
modules: 'qtmultimedia qtserialport'
|
||||
|
||||
- name: Setup SDL2
|
||||
id: setup-sdl2
|
||||
uses: libsdl-org/setup-sdl@v1
|
||||
with:
|
||||
version: ${{ env.SDL_VERSION }}
|
||||
build-type: "Release"
|
||||
|
||||
- name: Install Python Dependencies
|
||||
run: |
|
||||
echo $PATH
|
||||
$Python3_ROOT_DIR/python3.exe -m pip install clang jinja2 lz4 pillow pydantic
|
||||
|
||||
- name: Setup MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
CMAKE_BUILD_PARALLEL_LEVEL: 4
|
||||
run: |
|
||||
mkdir output && mkdir logs && \
|
||||
CMAKE_PREFIX_PATH="$QT_ROOT_DIR;$SDL2_ROOT" \
|
||||
tools/build-companion.sh "$(pwd)" "$(pwd)/output/" 2>&1 | tee logs/build-main.log
|
||||
|
||||
- name: Collect build logs
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
# Create logs directory if it doesn't exist
|
||||
mkdir -p logs
|
||||
|
||||
# Copy all build logs from the build directory
|
||||
if [ -d "build" ]; then
|
||||
find build -name "*.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||
find build -name "CMakeOutput.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||
find build -name "CMakeError.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
|
||||
fi
|
||||
|
||||
- name: Compose release filename
|
||||
if: always()
|
||||
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
||||
run: echo "artifact_name=edgetx-cpn-win64-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Archive production artifacts
|
||||
if: success()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: "${{ env.artifact_name }}"
|
||||
path: ${{github.workspace}}/output
|
||||
retention-days: 15
|
||||
|
||||
- name: Archive build logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: "${{ env.artifact_name }}-logs"
|
||||
path: ${{github.workspace}}/logs
|
||||
retention-days: 30
|
||||
Reference in New Issue
Block a user