Skip to content

Build with Unit and Integration Tests #2840

Build with Unit and Integration Tests

Build with Unit and Integration Tests #2840

Workflow file for this run

# Copyright © 2022 Cask Data, Inc.
# Licensed 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 install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build with Unit and Integration Tests
on:
workflow_run:
workflows:
- Trigger build
types:
- completed
workflow_dispatch:
inputs:
branch:
description: "Branch name on which workflow will be triggered"
required: true
default: "develop"
jobs:
build:
runs-on: k8s-runner-e2e
if: ${{ github.event.workflow_run.conclusion != 'skipped' }}
steps:
# Pinned 1.0.0 version
- uses: marocchino/action-workflow_run-status@54b6e87d6cb552fc5f36dbe9a722a6048725917a
if: github.event_name != 'workflow_dispatch'
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_sha }}
submodules: recursive
# installing node 16.16
- name: Use Node.js 16.16
uses: actions/[email protected]
with:
node-version: 16.16
- uses: actions/[email protected]
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Checkout cdap repo
uses: actions/checkout@v3
with:
repository: cdapio/cdap
path: cdap
- name: Make CDAP pom available to CDAP-UI
run: |
mv cdap ..
cd ../cdap
mv pom.xml ..
- name: Download CDAP Sandbox and Start it
run: |
cd sandboxjs
python3 sandbox_starter.py
- name: Install UI Dependencies
run: |
npm install -g yarn # Install Yarn globally
yarn --frozen-lockfile
yarn run bower-root # Install Bower dependencies (deprecated in develop branch, will be removed in a future version)
- name: Start CDAP-UI and run the tests
env:
GCP_PROJECTID: ${{ secrets.GCP_PROJECTID }}
GCP_SERVICE_ACCOUNT_CONTENTS: ${{ secrets.GCP_SERVICE_ACCOUNT_CONTENTS }}
GCP_SERVICE_ACCOUNT_PATH: '${{ github.workspace }}/key_file.json'
SCM_TEST_REPO_URL: ${{ secrets.SCM_TEST_REPO_URL }}
SCM_TEST_REPO_PAT: ${{ secrets.SCM_TEST_REPO_PAT }}
run: |
echo $GCP_SERVICE_ACCOUNT_CONTENTS > ./key_file.json
yarn run cdap-full-build-more-memory # Build UI
yarn start &
yarn run test:unit
mvn clean verify -P e2e-tests -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: Archive build artifacts
uses: actions/[email protected]
if: always()
with:
name: Build debug files
path: |
**/target/rat.txt
**/target/cucumber-html-report/
**/target/cucumber-reports/