2022-01-03 22:30:24 +00:00
|
|
|
# Builds Betaflight Configurator on Windows, Android, Linux and macOS platforms.
|
|
|
|
#
|
|
|
|
# After building, artifacts are released to a seperate repository.
|
|
|
|
|
|
|
|
name: CI
|
|
|
|
|
2022-02-17 10:17:00 +00:00
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
debug_build:
|
|
|
|
description: 'Specifies if it is a debug build or a release build'
|
|
|
|
default: true
|
|
|
|
required: false
|
|
|
|
type: boolean
|
2022-01-03 22:30:24 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Test
|
2022-05-19 19:43:02 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2022-01-03 22:30:24 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Node.js
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
cache: yarn
|
|
|
|
|
|
|
|
- run: yarn install --immutable --immutable-cache --check-cache
|
|
|
|
|
|
|
|
- name: Run unit tests
|
|
|
|
run: yarn test
|
|
|
|
|
|
|
|
build:
|
|
|
|
name: Build (${{ matrix.name }})
|
|
|
|
needs: test
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- name: Android
|
2022-05-19 19:43:02 +00:00
|
|
|
os: ubuntu-22.04
|
2022-01-03 22:30:24 +00:00
|
|
|
releaseArgs: --android
|
|
|
|
|
|
|
|
- name: Linux
|
2022-05-19 19:43:02 +00:00
|
|
|
os: ubuntu-22.04
|
2022-01-03 22:30:24 +00:00
|
|
|
releaseArgs: --linux64
|
|
|
|
|
|
|
|
- name: macOS
|
|
|
|
os: macos-11
|
|
|
|
releaseArgs: --osx64
|
|
|
|
|
|
|
|
- name: Windows
|
|
|
|
os: windows-2022
|
|
|
|
releaseArgs: --win64
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Cache NW.js
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: cache/
|
|
|
|
key: ${{ runner.os }}-${{ hashFiles('gulpfile.js') }}
|
|
|
|
|
|
|
|
- name: Install Node.js
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
cache: yarn
|
|
|
|
|
|
|
|
- name: Install Java JDK 8
|
|
|
|
uses: actions/setup-java@v2
|
|
|
|
if: ${{ matrix.name == 'Android' }}
|
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: '8'
|
|
|
|
|
|
|
|
- run: yarn install --immutable --immutable-cache --check-cache
|
|
|
|
|
|
|
|
- run: yarn gulp release ${{ matrix.releaseArgs }}
|
2022-02-17 10:17:00 +00:00
|
|
|
if: ${{ !inputs.debug_build && matrix.name != 'Android' }}
|
2022-01-03 22:30:24 +00:00
|
|
|
|
|
|
|
- run: yarn gulp debug-release ${{ matrix.releaseArgs }}
|
2022-02-17 10:17:00 +00:00
|
|
|
if: ${{ inputs.debug_build || matrix.name == 'Android' }}
|
2022-01-03 22:30:24 +00:00
|
|
|
|
|
|
|
- name: Publish build artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-02-17 10:17:00 +00:00
|
|
|
name: Betaflight-Configurator${{ inputs.debug_build == 'true' && '-Debug' || '' }}-${{ matrix.name }}
|
2022-01-03 22:30:24 +00:00
|
|
|
path: release/
|
2022-02-14 08:34:51 +00:00
|
|
|
retention-days: 90
|