Skip to content

feat: improve flashing speed #399

feat: improve flashing speed

feat: improve flashing speed #399

Workflow file for this run

name: pipeline
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Install
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
run: yarn --immutable
- name: Lint
run: yarn lint:all
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Install
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
run: yarn --immutable --mode=skip-build
- name: Format
run: yarn fmt:check
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Install
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
run: yarn --immutable
- name: Test
run: yarn test --coverage
env:
CI: true
- name: Publish Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
test-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Install
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
run: yarn --immutable
- name: Test types
run: yarn test:types
env:
CI: true
storybook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Install
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
run: yarn --immutable
- name: Build
run: yarn build:storybook
- name: Store storybook
uses: actions/upload-artifact@v4
with:
name: storybook-static
retention-days: 1
if-no-files-found: error
path: storybook-static
compile:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [macos-latest, ubuntu-20.04, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Setup Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install required python deps
run: python3 -m pip install setuptools
- name: Install
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
run: yarn --immutable
- name: Install build deps (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update && sudo apt-get install -y libudev-dev
- name: Build
run: yarn compile:production
env:
GITHUB_PR_BUILDS_KEY: ${{ secrets.PR_BUILDS_TOKEN }}
- name: Store compiled source
uses: actions/upload-artifact@v4
with:
name: compiled-${{ matrix.os }}
retention-days: 1
if-no-files-found: error
path: build
build-and-test-app:
runs-on: ${{ matrix.os }}
env:
DISPLAY: :0
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [macos-latest, ubuntu-20.04, windows-latest]
needs: compile
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Install
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
run: yarn --immutable
- name: Fetch compiled source
uses: actions/download-artifact@v4
with:
name: compiled-${{ matrix.os }}
path: build
- name: Build
run: yarn run pack
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: app-builds-${{ matrix.os }}
retention-days: 15
if-no-files-found: error
path: |
dist/*.snap
dist/*.AppImage
dist/*.msi
dist/*.dmg
dist/latest-mac.yml
dist/latest-linux.yml
- run: yarn playwright install --with-deps chromium chromium
- name: Setup xvfb (Linux)
if: runner.os == 'Linux'
run: |
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
- name: Run tests
run: yarn e2e:app
env:
CI: "true"
PWTEST_VIDEO: "true"
HEADFUL: "true"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: electron-${{ matrix.os }}-test-results
path: playwright-report
- name: Upload video recordings
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: electron-${{ matrix.os }}-recordings
path: e2e-recordings
# - name: Setup xvfb (Linux)
# if: runner.os == 'Linux'
# run: |
# sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
# # start xvfb in the background
# sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
# - name: E2E
# run: yarn e2e:production
# - name: Upload failure artifacts
# if: ${{ failure() }}
# uses: actions/upload-artifact@v2-preview
# with:
# name: diff
# path: |
# packages/configurator/e2e/output/*.png
# packages/configurator/e2e/output/*.webm
# packages/configurator/e2e/output/trace/*.zip
# - name: Preview demo
e2e-web:
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Install
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: yarn --immutable --mode=skip-build
- name: Install browsers
run: yarn playwright install --with-deps
- name: Fetch compiled source
uses: actions/download-artifact@v4
with:
name: compiled-ubuntu-20.04
path: build
- name: Run tests
run: yarn e2e:web
env:
CI: "true"
PWTEST_VIDEO: "true"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: video-web-linux-test-results
path: playwright-report
preview-web:
needs: [compile, storybook]
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch compiled source
uses: actions/download-artifact@v4
with:
name: compiled-ubuntu-20.04
path: build
- name: Fetch storybook build
uses: actions/download-artifact@v4
with:
name: storybook-static
path: build/renderer/storybook
- name: Deploy preview
id: cloudflare-preview
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy build/renderer --project-name=buddy
- name: Find preview comment if present
uses: peter-evans/find-comment@v3
id: find-preview-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Buddy has been automatically deployed to Cloudflare
- name: Create or update preview URL comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-preview-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
EdgeTX Buddy has been automatically deployed to Cloudflare.
✅ Preview: ${{ steps.cloudflare-preview.outputs.deployment-url }}
✅ Storybook: ${{ steps.cloudflare-preview.outputs.deployment-url }}/storybook
edit-mode: replace
release-web-prod:
needs: [e2e-web, test, storybook]
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- name: Fetch compiled source
uses: actions/download-artifact@v4
with:
name: compiled-ubuntu-20.04
path: build
- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: buddy
directory: build/renderer
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
release-app:
needs: [build-and-test-app, test]
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- name: Fetch binaries
uses: actions/download-artifact@v4
with:
pattern: app-builds-*
path: app-builds
merge-multiple: true
- name: Release latest build
if: startsWith(github.ref, 'refs/tags/v') != true
uses: marvinpinto/action-automatic-releases@4edd7a5aabb1bc62e6dc99b3302d587bf3134e20
with:
title: "Latest Build"
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: app-builds/*
automatic_release_tag: "latest"
prerelease: true
- name: Release tagged build
if: startsWith(github.ref, 'refs/tags/v')
uses: marvinpinto/action-automatic-releases@4edd7a5aabb1bc62e6dc99b3302d587bf3134e20
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: app-builds/*
prerelease: false