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:
|
2022-10-05 06:30:17 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-03 22:30:24 +00:00
|
|
|
|
2022-10-05 06:33:11 +00:00
|
|
|
- name: Cache node_modules
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: node_modules/
|
|
|
|
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
|
|
|
|
2022-01-03 22:30:24 +00:00
|
|
|
- name: Install Node.js
|
2022-10-05 06:30:17 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-01-03 22:30:24 +00:00
|
|
|
with:
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
|
|
|
|
- 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:
|
2022-10-05 06:30:17 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-03 22:30:24 +00:00
|
|
|
|
|
|
|
- name: Cache NW.js
|
2022-10-05 06:30:17 +00:00
|
|
|
uses: actions/cache@v3
|
2022-01-03 22:30:24 +00:00
|
|
|
with:
|
|
|
|
path: cache/
|
|
|
|
key: ${{ runner.os }}-${{ hashFiles('gulpfile.js') }}
|
|
|
|
|
2022-10-05 06:33:11 +00:00
|
|
|
- name: Cache node_modules
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: node_modules/
|
|
|
|
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
|
|
|
|
2022-01-03 22:30:24 +00:00
|
|
|
- name: Install Node.js
|
2022-10-05 06:30:17 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-01-03 22:30:24 +00:00
|
|
|
with:
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
|
|
|
|
- name: Install Java JDK 8
|
2022-10-13 14:18:31 +00:00
|
|
|
uses: actions/setup-java@v3
|
2022-01-03 22:30:24 +00:00
|
|
|
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
|
2022-10-05 06:30:17 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-01-03 22:30:24 +00:00
|
|
|
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
|