Skip to content

Commit

Permalink
Use GitHub Actions for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasvr committed Jan 4, 2022
1 parent d948281 commit 9fac7b0
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 1 deletion.
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Builds Betaflight Configurator on Windows, Android, Linux and macOS platforms.
#
# After building, artifacts are released to a seperate repository.

name: CI

on:
push:
branches:
- master
- '*-maintenance'
pull_request:
branches:
- master
- '*-maintenance'

jobs:
test:
name: Test
runs-on: ubuntu-20.04

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

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@043296c976c53f4536194ebe3841ed720e04d496 # v1.26
if: always()
with:
files: test-results-junit/**/*.xml
comment_mode: 'off'

build:
name: Build (${{ matrix.name }})
needs: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: Android
os: ubuntu-20.04
releaseArgs: --android

- name: Linux
os: ubuntu-20.04
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('cache/**') }}

- 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 }}
- run: yarn gulp debug-release ${{ matrix.releaseArgs }}

- name: Publish build artifacts
uses: actions/upload-artifact@v2
with:
name: Betaflight-Configurator-${{ matrix.name }}
path: release/
retention-days: 3
2 changes: 1 addition & 1 deletion test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = function(config) {
outputFile: 'test_results.xml',
},
junitReporter: {
outputDir: 'test-results-junit'
outputDir: 'test-results-junit',
},
singleRun: true,
preprocessors: {
Expand Down

0 comments on commit 9fac7b0

Please sign in to comment.