| |
| # 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. |
| |
| # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs |
| |
| name: Node.js CI |
| |
| on: |
| push: |
| branches: [ "master" ] |
| pull_request: |
| branches: [ "master" ] |
| |
| jobs: |
| build: |
| strategy: |
| matrix: |
| node-version: [14.x, 16.x] |
| os: [ubuntu-latest, ubuntu-18.04] |
| # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ |
| runs-on: ${{ matrix.os }} |
| |
| steps: |
| - uses: actions/checkout@v3 |
| - name: Use Node.js ${{ matrix.node-version }} |
| uses: actions/setup-node@v3 |
| with: |
| node-version: ${{ matrix.node-version }} |
| cache: 'npm' |
| cache-dependency-path: webui/package-lock.json |
| - run: pushd webui && npm ci && popd |
| - run: pushd webui && npm run build --if-present && popd |
| - run: pushd webui && npm test && popd |