From a99c0bbd7368dcdb39d929096c79b5546dc5a22e Mon Sep 17 00:00:00 2001 From: YannC Date: Fri, 7 Feb 2025 09:10:38 +0100 Subject: [PATCH] fix(): correct usage of paths-filter action --- .../actions/action-frontend-test/action.yml | 17 +++++++---- .../action-generate-translations/action.yml | 7 ++++- .github/workflows/main.yml | 30 +++++++++---------- .github/workflows/workflow-pr.yml | 12 ++++++-- 4 files changed, 43 insertions(+), 23 deletions(-) diff --git a/.github/actions/action-frontend-test/action.yml b/.github/actions/action-frontend-test/action.yml index 6e24ae534c8..1fbb610fa2d 100644 --- a/.github/actions/action-frontend-test/action.yml +++ b/.github/actions/action-frontend-test/action.yml @@ -1,10 +1,10 @@ name: 'Frontend Test' inputs: - example-input: - description: 'An example input' - required: false - default: 'default value' + github-token: + description: 'GitHub Token' + required: true + runs: using: composite @@ -22,10 +22,17 @@ runs: - name: Npm lint uses: reviewdog/action-eslint@v1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ inputs.GITHUB_TOKEN }} reporter: github-pr-review # Change reporter. workdir: "ui" + - name: Npm - Run build + shell: bash + working-directory: ui + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: npm run build + - name: Run front-end unit tests shell: bash working-directory: ui diff --git a/.github/actions/action-generate-translations/action.yml b/.github/actions/action-generate-translations/action.yml index 07571ce04cf..f09eebcfa6b 100644 --- a/.github/actions/action-generate-translations/action.yml +++ b/.github/actions/action-generate-translations/action.yml @@ -1,6 +1,11 @@ name: Generate Translations description: "Required the environment variable OPENAI_API_KEY to be set. This action will generate translations for the UI." +inputs: + github-token: + description: 'GitHub Token' + required: true + runs: using: composite @@ -41,7 +46,7 @@ runs: - name: Check for changes and commit env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ inputs.github-token }} shell: bash run: | git add ui/src/translations/*.json diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a30ae17020..a10eacd5aac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,21 +11,21 @@ on: # - develop # repository_dispatch: # types: [rebuild] - workflow_dispatch: - inputs: - skip-test: - description: "Skip test" - type: choice - required: true - default: "false" - options: - - "true" - - "false" - plugin-version: - description: "Plugin version" - required: false - type: string - default: "LATEST" +# workflow_dispatch: +# inputs: +# skip-test: +# description: "Skip test" +# type: choice +# required: true +# default: "false" +# options: +# - "true" +# - "false" +# plugin-version: +# description: "Plugin version" +# required: false +# type: string +# default: "LATEST" concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/workflow-pr.yml b/.github/workflows/workflow-pr.yml index ced999eb273..9a2dd0ac723 100644 --- a/.github/workflows/workflow-pr.yml +++ b/.github/workflows/workflow-pr.yml @@ -35,8 +35,7 @@ jobs: translations: - 'ui/src/translations/**' backend: - - '!ui/**' - - '!.github/**' + - '!{ui,.github}/**' token: ${{ secrets.GITHUB_TOKEN }} frontend: @@ -52,12 +51,16 @@ jobs: name: Generate translations if: "needs.file-changes.outputs.translations == 'true'" uses: ./.github/actions/action-generate-translations + with: + github-token: ${{ secrets.GITHUB_TOKEN }} env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - id: frontend-test name: Frontend test uses: ./.github/actions/action-frontend-test + with: + github-token: ${{ secrets.GITHUB_TOKEN }} backend: name: 'Check Backend' @@ -70,6 +73,11 @@ jobs: - name: Backend test uses: ./.github/actions/action-backend-test + with: + codecov-token: ${{ secrets.CODECOV_TOKEN }} + sonar-token: ${{ secrets.SONAR_TOKEN }} + github-token: ${{ secrets.GH_PERSONAL_TOKEN }} + google-service-account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} build-artifacts: if: "needs.file-changes.outputs.backend == 'true' || needs.file-changes.outputs.ui == 'true'"