feat: added test script substitution

This commit is contained in:
Thomas Sauter 2025-10-22 22:49:44 +02:00
parent 86c23b7d53
commit d1564129b6
Signed by: thomas.sauter
GPG key ID: 015161F81E6A3C65
2 changed files with 13 additions and 6 deletions

View file

@ -14,6 +14,10 @@ on:
required: false required: false
type: string type: string
default: yarn run setup default: yarn run setup
TEST_SCRIPT:
required: false
type: string
default: yarn run test --ci --passWithNoTests --coverage
jobs: jobs:
linting_type_checking: linting_type_checking:
@ -53,7 +57,7 @@ jobs:
- name: Run tests - name: Run tests
if: ${{ inputs.TESTS_ENABLED == true }} if: ${{ inputs.TESTS_ENABLED == true }}
run: | run: |
yarn run test --ci --passWithNoTests --coverage ${{ inputs.TEST_SCRIPT }}
- name: Static code analysis with SonarQube - name: Static code analysis with SonarQube
uses: https://github.com/SonarSource/sonarqube-scan-action@v5 uses: https://github.com/SonarSource/sonarqube-scan-action@v5

View file

@ -77,10 +77,13 @@ Linting, type checking, sonarqube, dependency tracking, any testing
##### Inputs ##### Inputs
| Key | Description | Required | | Key | Description | Required |
| ------------------- | ----------------------------------------------------------------------------------- | -------- | | ------------------- | ---------------------------------------------------------------------------------- | -------- |
| `SONARQUBE_ENABLED` | Send source to sonarqube for code analysis; default: `false` | | | `SONARQUBE_ENABLED` | Send source to sonarqube for code analysis; default: `false` | |
| `TESTS_ENABLED` | Enable test suites; default: `false` | | | `TESTS_ENABLED` | Enable test suites; default: `false` | |
| `SETUP_REPO_SCRIPT` | Script which runs after install for setting up the repo; default: `yarn run setup`) | | | `SETUP_REPO_SCRIPT` | Script which runs after install for setting up the repo; default: `yarn run setup` | |
| `TEST_SCRIPT` | Script which runs when tests are enabled; default: `yarn run test:coverage:lcov` | |
TEST_SCRIPT
##### Secrets ##### Secrets