blob: 7cae877ad99cd778a30b0f30294f0762f4b01384 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
---
name: FE Web UI
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.ref }} (FE Web UI)
cancel-in-progress: true
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
ui_changes: ${{ steps.filter.outputs.ui_changes }}
steps:
- name: Checkout ${{ github.ref }}
uses: actions/checkout@v3
with:
persist-credentials: false
submodules: recursive
- name: Paths filter
uses: ./.github/actions/paths-filter
id: filter
with:
filters: |
ui_changes:
- 'ui/**'
- '.github/workflows/build-ui.yml'
build-ui:
name: Lint, Typecheck, Test and Build
needs: changes
if: ${{ needs.changes.outputs.ui_changes == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ github.ref }}
uses: actions/checkout@v3
with:
persist-credentials: false
# Keep this in step with the "engines" floor in ui/package.json and with the Node version
# the compilation images install, so a green build here means ./build.sh --fe also builds.
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.12.0'
# Same resolution as build.sh: the committed lockfile, with --legacy-peer-deps.
- name: Install dependencies
run: npm ci --legacy-peer-deps
working-directory: ui
- name: Lint
run: npm run lint
working-directory: ui
- name: Typecheck
run: npm run typecheck
working-directory: ui
- name: Unit tests
run: npm run test
working-directory: ui
- name: Production build
run: npm run build
working-directory: ui