mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-24 01:23:21 +08:00
* dbeaver/pro#6436 initializes unit tests for common-react * installs common-react in the scripts * adds @dbeaver/react-tests * setups @dbeaver/react-test into tests-runner * implements react-testing library into @dbeaver/react-tests * removes unused deps * adds test for frontend build github action
99 lines
2.7 KiB
YAML
99 lines
2.7 KiB
YAML
name: Frontend Build
|
|
|
|
on:
|
|
# Allows you to reuse workflows by referencing their YAML files
|
|
workflow_call:
|
|
outputs:
|
|
build-status:
|
|
description: "Build status"
|
|
value: ${{ jobs.frontend-build.outputs.build-status }}
|
|
test-status:
|
|
description: "Test status"
|
|
value: ${{ jobs.frontend-build.outputs.test-status }}
|
|
inputs:
|
|
clean-cache:
|
|
required: false
|
|
type: boolean
|
|
|
|
jobs:
|
|
frontend-build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
permissions:
|
|
contents: read
|
|
|
|
outputs:
|
|
build-status: ${{ steps.build.outcome }}
|
|
test-status: ${{ steps.test.outcome }}
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: ./cloudbeaver/webapp
|
|
|
|
steps:
|
|
- name: Checkout cloudbeaver
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: cloudbeaver
|
|
|
|
- name: Clone Deps Repositories
|
|
uses: dbeaver/github-actions/clone-repositories@devel
|
|
with:
|
|
project_deps_path: "./cloudbeaver/project.deps"
|
|
token: ${{ secrets.DEVOPS_ISSUE_RO_TOKEN }}
|
|
|
|
- run: corepack enable
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "lts/*"
|
|
cache: "yarn"
|
|
cache-dependency-path: |
|
|
cloudbeaver/common-*/yarn.lock
|
|
cloudbeaver/webapp/yarn.lock
|
|
|
|
- name: restore cloudbeaver-common typescript cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: "cloudbeaver/common-*/**/*/lib"
|
|
key: ${{ runner.os }}-common-dist-${{ hashFiles('cloudbeaver/common-*/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-common-dist-
|
|
|
|
- name: restore typescript cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: "cloudbeaver/webapp/**/packages/*/dist"
|
|
key: ${{ runner.os }}-dist-${{ hashFiles('cloudbeaver/webapp/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-dist-
|
|
|
|
- if: inputs.clean-cache
|
|
run: yarn clear
|
|
|
|
- run: yarn install --immutable
|
|
working-directory: ./cloudbeaver/common-typescript
|
|
|
|
- run: yarn install --immutable
|
|
working-directory: ./cloudbeaver/common-react
|
|
|
|
- run: yarn install --immutable
|
|
|
|
- run: yarn bundle
|
|
working-directory: ./cloudbeaver/webapp/packages/product-default
|
|
|
|
- run: yarn test
|
|
working-directory: ./cloudbeaver/common-typescript
|
|
|
|
- run: yarn test
|
|
working-directory: ./cloudbeaver/common-react
|
|
|
|
- run: yarn test
|
|
|
|
# - name: Archive build artifacts
|
|
# uses: actions/upload-artifact@v4
|
|
# with:
|
|
# name: frontend-build-artifacts
|
|
# path: webapp/packages/product-default/lib
|
|
# if-no-files-found: error
|