2020-05-18 19:51:04 +00:00
|
|
|
name: FreqUI CI
|
2020-05-18 18:28:24 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-10-28 17:39:02 +00:00
|
|
|
- main
|
2021-12-17 18:40:15 +00:00
|
|
|
- ci/**
|
2020-05-18 18:28:24 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-10-28 17:39:02 +00:00
|
|
|
- main
|
2020-12-06 09:26:02 +00:00
|
|
|
release:
|
2020-12-06 11:53:20 +00:00
|
|
|
types: [ published ]
|
2020-05-18 18:28:24 +00:00
|
|
|
|
2022-06-07 04:44:07 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-05-18 18:28:24 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-10-30 14:09:02 +00:00
|
|
|
os: [ ubuntu-22.04 ]
|
2023-04-11 05:15:42 +00:00
|
|
|
node: [ "16", "18", "19"]
|
2020-05-18 18:28:24 +00:00
|
|
|
|
|
|
|
steps:
|
2022-03-02 05:27:57 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-05-18 18:28:24 +00:00
|
|
|
|
2022-03-02 05:28:01 +00:00
|
|
|
- uses: actions/setup-node@v3
|
2022-06-13 17:30:00 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
2020-12-05 18:43:24 +00:00
|
|
|
|
|
|
|
- run: yarn install
|
2020-05-18 18:28:24 +00:00
|
|
|
|
2020-05-18 18:49:30 +00:00
|
|
|
- name: Run Lint
|
2020-12-05 18:52:32 +00:00
|
|
|
run: yarn lint-ci
|
2020-11-10 19:52:39 +00:00
|
|
|
|
2021-01-16 14:57:55 +00:00
|
|
|
- name: Run type check
|
|
|
|
run: yarn check-types
|
|
|
|
|
2021-12-18 10:16:15 +00:00
|
|
|
- name: Run Tests
|
|
|
|
run: yarn test:unit
|
2021-12-17 18:52:26 +00:00
|
|
|
|
2021-12-18 10:16:15 +00:00
|
|
|
- name: Run Component tests
|
2022-12-07 05:03:35 +00:00
|
|
|
uses: cypress-io/github-action@v5
|
2021-12-17 18:40:15 +00:00
|
|
|
with:
|
2021-12-17 18:52:26 +00:00
|
|
|
# we have already installed everything
|
|
|
|
install: false
|
|
|
|
# to run component tests we need to use "cypress run-ct"
|
|
|
|
command: yarn cypress run-ct
|
2020-12-05 18:52:32 +00:00
|
|
|
|
2022-01-01 18:52:46 +00:00
|
|
|
- name: Cypress run
|
2022-12-07 05:03:35 +00:00
|
|
|
uses: cypress-io/github-action@v5
|
2022-01-01 18:52:46 +00:00
|
|
|
with:
|
2022-01-01 19:03:06 +00:00
|
|
|
# build: yarn build
|
2023-04-11 05:28:04 +00:00
|
|
|
start: yarn serve
|
2022-02-05 19:13:18 +00:00
|
|
|
wait-on: 'http://localhost:3000'
|
2022-01-01 18:52:46 +00:00
|
|
|
|
2020-12-05 18:52:32 +00:00
|
|
|
- name: Build build
|
|
|
|
run: yarn build
|
|
|
|
|
2020-12-05 19:04:09 +00:00
|
|
|
- name: Archive artifacts
|
2022-04-13 05:13:25 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-12-06 12:45:05 +00:00
|
|
|
# Ideally this would upload the zipfile from below - but this action currently does not support this.
|
2020-12-05 18:52:32 +00:00
|
|
|
with:
|
2020-12-06 12:52:12 +00:00
|
|
|
name: freqUI
|
2020-12-05 18:52:32 +00:00
|
|
|
path: |
|
2020-12-06 12:45:05 +00:00
|
|
|
dist
|
|
|
|
!dist/**/*.map
|
2020-12-05 18:52:32 +00:00
|
|
|
retention-days: 10
|
2020-12-06 09:26:02 +00:00
|
|
|
|
2020-12-06 12:45:05 +00:00
|
|
|
- name: Zip files for release
|
2022-06-21 17:52:08 +00:00
|
|
|
if: github.event_name == 'release' && matrix.node == '18'
|
2020-12-06 12:45:05 +00:00
|
|
|
run: |
|
|
|
|
cd dist/
|
|
|
|
zip -r ../freqUI.zip .
|
|
|
|
cd ../
|
|
|
|
|
|
|
|
|
2020-12-06 09:26:02 +00:00
|
|
|
- name: Upload release binaries
|
2022-11-02 05:11:49 +00:00
|
|
|
uses: alexellis/upload-assets@0.4.0
|
2022-06-21 18:04:08 +00:00
|
|
|
if: github.event_name == 'release' && matrix.node == '18'
|
2020-12-06 09:26:02 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
|
with:
|
2020-12-06 12:28:24 +00:00
|
|
|
asset_paths: '["./freqUI.zip"]'
|