Skip to content

Commit

Permalink
fix(): correct usage of paths-filter action
Browse files Browse the repository at this point in the history
  • Loading branch information
Skraye committed Feb 7, 2025
1 parent 505d751 commit 690397e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 23 deletions.
17 changes: 12 additions & 5 deletions .github/actions/action-frontend-test/action.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion .github/actions/action-generate-translations/action.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/workflow-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ jobs:
translations:
- 'ui/src/translations/**'
backend:
- '!ui/**'
- '!.github/**'
- '!{ui,.github}/**'
token: ${{ secrets.GITHUB_TOKEN }}

frontend:
Expand All @@ -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'
Expand All @@ -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'"
Expand Down

0 comments on commit 690397e

Please sign in to comment.