From 82d1b1c6cf295519709929589ec592c1cbc84f50 Mon Sep 17 00:00:00 2001 From: Jochen Just Date: Fri, 10 Mar 2023 12:20:23 +0100 Subject: [PATCH] Properly builds UI on UI related changes --- .github/workflows/configuration_ui_test.yml | 25 ++++--------------- .../build.gradle | 17 ++++++++++--- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/.github/workflows/configuration_ui_test.yml b/.github/workflows/configuration_ui_test.yml index a1cb7e28f0..2550566f9b 100644 --- a/.github/workflows/configuration_ui_test.yml +++ b/.github/workflows/configuration_ui_test.yml @@ -9,30 +9,15 @@ on: - 'components/inspectit-ocelot-configurationserver-ui/**' workflow_call: - jobs: test: name: Test runs-on: ubuntu-latest + container: openjdk:8-jdk env: - working-directory: ./components/inspectit-ocelot-configurationserver-ui - + working-directory: ./components/inspectit-ocelot-configurationserver steps: - - uses: actions/checkout@v2 - - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - - name: Install dependencies - working-directory: ${{env.working-directory}} - run: yarn install - - - name: Run Eslint - working-directory: ${{env.working-directory}} - run: yarn lint - - - name: Run Prettier + - uses: actions/checkout@v3 + - name: Build frontend working-directory: ${{env.working-directory}} - run: yarn format + run: ../../gradlew buildFrontend diff --git a/components/inspectit-ocelot-configurationserver/build.gradle b/components/inspectit-ocelot-configurationserver/build.gradle index bb8638ffbf..dd8f600aec 100644 --- a/components/inspectit-ocelot-configurationserver/build.gradle +++ b/components/inspectit-ocelot-configurationserver/build.gradle @@ -40,19 +40,28 @@ node { /** * Task for installing the frontend dependencies. */ -task installFrontend(type: YarnTask) { +def installFrontend = tasks.register('installFrontend', YarnTask) { args = ['install'] } +def lintFrontend = tasks.register('lintFrontend', YarnTask) { + dependsOn installFrontend + args = ['lint'] +} + +def checkCodeStyleFrontend = tasks.register('checkCodeStyleFrontend', YarnTask) { + dependsOn installFrontend + args = ['format'] +} + /** * Task for building the frontend and copying it to the configuration-server project. */ -task buildFrontend(type: YarnTask) { +tasks.register('buildFrontend', YarnTask) { + dependsOn lintFrontend, checkCodeStyleFrontend args = ['export'] environment = [NODE_OPTIONS: "--openssl-legacy-provider"] } -buildFrontend.dependsOn installFrontend - def serverMainClass = 'rocks.inspectit.ocelot.ConfigurationServer'