-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(): correct usage of paths-filter action
- Loading branch information
Showing
4 changed files
with
44 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
name: 'Basic Multi-Step Action' | ||
description: 'A basic GitHub Action that runs multiple steps.' | ||
name: 'Backend Test' | ||
|
||
inputs: | ||
example-input: | ||
description: 'An example input' | ||
google-service-account: | ||
description: 'Google Service Account' | ||
required: true | ||
sonar-token: | ||
description: 'Sonar Token' | ||
required: false | ||
github-token: | ||
description: 'GitHub Token' | ||
required: true | ||
codecov-token: | ||
description: 'Codecov Token' | ||
required: false | ||
default: 'default value' | ||
|
||
runs: | ||
using: composite | ||
|
@@ -29,7 +36,7 @@ runs: | |
- name: Build with Gradle | ||
if: ${{ github.event.inputs.skip-test == 'false' || github.event.inputs.skip-test == '' }} | ||
env: | ||
GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} | ||
GOOGLE_SERVICE_ACCOUNT: ${{ inputs.google-service-account }} | ||
shell: bash | ||
run: | | ||
echo $GOOGLE_SERVICE_ACCOUNT | base64 -d > ~/.gcp-service-account.json | ||
|
@@ -38,28 +45,28 @@ runs: | |
# Sonar | ||
- name: Analyze with Sonar | ||
if: ${{ env.SONAR_TOKEN != 0 }} | ||
if: ${{ inputs.sonar-token != '' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
GITHUB_TOKEN: ${{ inputs.github-token }} | ||
SONAR_TOKEN: ${{ inputs.sonar-token }} | ||
shell: bash | ||
run: ./gradlew sonar --info | ||
|
||
# Allure check | ||
- name: Auth to Google Cloud | ||
id: auth | ||
if: ${{ always() && env.GOOGLE_SERVICE_ACCOUNT != 0 }} | ||
if: ${{ always() && inputs.google-service-account != '' }} | ||
uses: "google-github-actions/auth@v2" | ||
with: | ||
credentials_json: "${{ secrets.GOOGLE_SERVICE_ACCOUNT }}" | ||
credentials_json: "${{ inputs.google-service-account }}" | ||
|
||
- uses: rlespinasse/github-slug-action@v5 | ||
|
||
- name: Publish allure report | ||
uses: andrcuns/[email protected] | ||
if: ${{ always() && env.GOOGLE_SERVICE_ACCOUNT != 0 }} | ||
if: ${{ always() && inputs.google-service-account != '' }} | ||
env: | ||
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_AUTH_TOKEN: ${{ inputs.github-token }} | ||
JAVA_HOME: /usr/lib/jvm/default-jvm/ | ||
with: | ||
storageType: gcs | ||
|
@@ -72,11 +79,11 @@ runs: | |
|
||
# Jacoco | ||
- name: "Set up Cloud SDK" | ||
if: ${{ env.GOOGLE_SERVICE_ACCOUNT != 0 }} | ||
if: ${{ inputs.google-service-account != '' }} | ||
uses: "google-github-actions/setup-gcloud@v2" | ||
|
||
- name: "Copy jacoco files" | ||
if: ${{ env.GOOGLE_SERVICE_ACCOUNT != 0 }} | ||
if: ${{ inputs.google-service-account != '' }} | ||
shell: bash | ||
run: | | ||
mv build/reports/jacoco/testCodeCoverageReport build/reports/jacoco/test/ | ||
|
@@ -93,4 +100,4 @@ runs: | |
# Codecov | ||
- uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
token: ${{ inputs.codecov-token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ description: "Required the environment variable OPENAI_API_KEY to be set. This a | |
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
@@ -16,9 +17,11 @@ runs: | |
python-version: "3.x" | ||
|
||
- name: Install Python dependencies | ||
shell: bash | ||
run: pip install gitpython openai | ||
|
||
- name: Generate translations | ||
shell: bash | ||
run: python ui/src/translations/generate_translations.py | ||
|
||
- name: Set up Node | ||
|
@@ -27,16 +30,19 @@ runs: | |
node-version: "20.x" | ||
|
||
- name: Check keys matching | ||
shell: bash | ||
run: node ui/src/translations/check.js | ||
|
||
- name: Set up Git | ||
shell: bash | ||
run: | | ||
git config --global user.name "GitHub Action" | ||
git config --global user.email "[email protected]" | ||
- name: Check for changes and commit | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
shell: bash | ||
run: | | ||
git add ui/src/translations/*.json | ||
if git diff --cached --quiet; then | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters