mirror of
https://github.com/IT4Change/boilerplate-frontend.git
synced 2025-12-13 07:35:53 +00:00
Merge pull request #3 from IT4Change/workflow-unit-tests
feat(workflow): test:unit workflow
This commit is contained in:
commit
43bf5485eb
5
.github/file-filters.yml
vendored
5
.github/file-filters.yml
vendored
@ -1,4 +1,7 @@
|
|||||||
# These file filter patterns are used by the action https://github.com/dorny/paths-filter
|
# These file filter patterns are used by the action https://github.com/dorny/paths-filter
|
||||||
|
|
||||||
frontend: &frontend
|
frontend-test-lint-code: &frontend-test-lint-code
|
||||||
|
- '**/*'
|
||||||
|
|
||||||
|
frontend-test-unit-code: &frontend-test-unit-code
|
||||||
- '**/*'
|
- '**/*'
|
||||||
6
.github/workflows/test.lint.code.yml
vendored
6
.github/workflows/test.lint.code.yml
vendored
@ -6,10 +6,10 @@ jobs:
|
|||||||
# only (but most important) job from this workflow required for pull requests
|
# only (but most important) job from this workflow required for pull requests
|
||||||
# check results serve as run conditions for all other jobs here
|
# check results serve as run conditions for all other jobs here
|
||||||
files-changed:
|
files-changed:
|
||||||
name: Detect File Changes - Frontend
|
name: Detect File Changes - frontend-test-lint-code
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
frontend: ${{ steps.changes.outputs.frontend }}
|
frontend-test-lint-code: ${{ steps.changes.outputs.frontend-test-lint-code }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v3.3.0
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ jobs:
|
|||||||
list-files: shell
|
list-files: shell
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
if: needs.files-changed.outputs.frontend == 'true'
|
if: needs.files-changed.outputs.frontend-test-lint-code == 'true'
|
||||||
name: Lint - Frontend
|
name: Lint - Frontend
|
||||||
needs: files-changed
|
needs: files-changed
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
34
.github/workflows/test.unit.code.yml
vendored
Normal file
34
.github/workflows/test.unit.code.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
name: "test:unit test code with defined suites"
|
||||||
|
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# only (but most important) job from this workflow required for pull requests
|
||||||
|
# check results serve as run conditions for all other jobs here
|
||||||
|
files-changed:
|
||||||
|
name: Detect File Changes - frontend-test-unit-code
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
frontend-test-unit-code: ${{ steps.changes.outputs.frontend-test-unit-code }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3.3.0
|
||||||
|
|
||||||
|
- name: Check for frontend file changes
|
||||||
|
uses: dorny/paths-filter@v2.11.1
|
||||||
|
id: changes
|
||||||
|
with:
|
||||||
|
token: ${{ github.token }}
|
||||||
|
filters: .github/file-filters.yml
|
||||||
|
list-files: shell
|
||||||
|
|
||||||
|
unit:
|
||||||
|
if: needs.files-changed.outputs.frontend-test-unit-code == 'true'
|
||||||
|
name: Unit - Frontend
|
||||||
|
needs: files-changed
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Frontend | Unit
|
||||||
|
run: npm install && npm run test:unit
|
||||||
Loading…
x
Reference in New Issue
Block a user