mirror of
https://github.com/IT4Change/boilerplate-frontend.git
synced 2025-12-13 07:35:53 +00:00
Merge pull request #4 from IT4Change/workflow-build
feat(workflow): build test workflow
This commit is contained in:
commit
3bb89e5b4d
3
.github/file-filters.yml
vendored
3
.github/file-filters.yml
vendored
@ -5,3 +5,6 @@ frontend-test-lint-code: &frontend-test-lint-code
|
|||||||
|
|
||||||
frontend-test-unit-code: &frontend-test-unit-code
|
frontend-test-unit-code: &frontend-test-unit-code
|
||||||
- '**/*'
|
- '**/*'
|
||||||
|
|
||||||
|
frontend-test-build-code: &frontend-test-build-code
|
||||||
|
- '**/*'
|
||||||
34
.github/workflows/test.build.code.yml
vendored
Normal file
34
.github/workflows/test.build.code.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
name: "test:build test code"
|
||||||
|
|
||||||
|
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-build-code
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
changes: ${{ steps.changes.outputs.frontend-test-build-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
|
||||||
|
|
||||||
|
build:
|
||||||
|
if: needs.files-changed.outputs.changes == 'true'
|
||||||
|
name: Build - Frontend
|
||||||
|
needs: files-changed
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Frontend | Build
|
||||||
|
run: npm install && npm run build
|
||||||
4
.github/workflows/test.lint.code.yml
vendored
4
.github/workflows/test.lint.code.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
|||||||
name: Detect File Changes - frontend-test-lint-code
|
name: Detect File Changes - frontend-test-lint-code
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
frontend-test-lint-code: ${{ steps.changes.outputs.frontend-test-lint-code }}
|
changes: ${{ 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-test-lint-code == 'true'
|
if: needs.files-changed.outputs.changes == 'true'
|
||||||
name: Lint - Frontend
|
name: Lint - Frontend
|
||||||
needs: files-changed
|
needs: files-changed
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
4
.github/workflows/test.lint.pr.yml
vendored
4
.github/workflows/test.lint.pr.yml
vendored
@ -7,8 +7,8 @@ on:
|
|||||||
- edited
|
- edited
|
||||||
- synchronize
|
- synchronize
|
||||||
|
|
||||||
permissions:
|
permissions: write-all
|
||||||
pull-requests: write
|
# pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
|
|||||||
4
.github/workflows/test.unit.code.yml
vendored
4
.github/workflows/test.unit.code.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
|||||||
name: Detect File Changes - frontend-test-unit-code
|
name: Detect File Changes - frontend-test-unit-code
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
frontend-test-unit-code: ${{ steps.changes.outputs.frontend-test-unit-code }}
|
changes: ${{ steps.changes.outputs.frontend-test-unit-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
|
||||||
|
|
||||||
unit:
|
unit:
|
||||||
if: needs.files-changed.outputs.frontend-test-unit-code == 'true'
|
if: needs.files-changed.outputs.changes == 'true'
|
||||||
name: Unit - Frontend
|
name: Unit - Frontend
|
||||||
needs: files-changed
|
needs: files-changed
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
19
README.md
19
README.md
@ -30,7 +30,7 @@ This projects utilizes `storybook` to develop frontend components and `vuepress`
|
|||||||
The following commands are available:
|
The following commands are available:
|
||||||
|
|
||||||
| Command | Description |
|
| Command | Description |
|
||||||
|------------------------------|-------------------------------------------------|
|
|----------------------------|-------------------------------------------------|
|
||||||
| `npm install` | Project setup |
|
| `npm install` | Project setup |
|
||||||
| `npm run build` | Compiles and minifies for production |
|
| `npm run build` | Compiles and minifies for production |
|
||||||
| `npm run server:prod` | Runs productions server |
|
| `npm run server:prod` | Runs productions server |
|
||||||
@ -41,8 +41,8 @@ The following commands are available:
|
|||||||
| `npm run test:lint` | Run all linters |
|
| `npm run test:lint` | Run all linters |
|
||||||
| `npm run test:lint:eslint` | Run linter eslint |
|
| `npm run test:lint:eslint` | Run linter eslint |
|
||||||
| `npm run test:lint:remark` | Run linter remark |
|
| `npm run test:lint:remark` | Run linter remark |
|
||||||
| `npm run test:unit` | Run all unit tests in watch mode |
|
| `npm run test:unit` | Run all unit tests and generate coverage report |
|
||||||
| `npm run test:unit:coverage` | Run all unit tests and generate coverage report |
|
| `npm run test:unit:dev` | Run all unit tests in watch mode |
|
||||||
| `npm test` | Run all tests & linters |
|
| `npm test` | Run all tests & linters |
|
||||||
| **Storybook** | |
|
| **Storybook** | |
|
||||||
| `npm run storybook` | Run Storybook |
|
| `npm run storybook` | Run Storybook |
|
||||||
@ -76,20 +76,11 @@ The following endpoints are provided given the right command is executed or all
|
|||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- [x] vite
|
|
||||||
- [x] vike
|
|
||||||
- [x] vue3
|
|
||||||
- [x] vuetify
|
|
||||||
- [x] pinia store
|
|
||||||
- [x] storybook
|
|
||||||
- [x] eslint
|
|
||||||
- [x] vitest
|
|
||||||
- [x] vue-i18n
|
|
||||||
- [x] docker
|
|
||||||
- [x] vuepress
|
|
||||||
- [ ] figma
|
- [ ] figma
|
||||||
- [ ] chromatic
|
- [ ] chromatic
|
||||||
- [ ] github actions
|
- [ ] github actions
|
||||||
|
- [ ] lint locales
|
||||||
|
- [ ] zähler -> pinia
|
||||||
|
|
||||||
## Known Problems
|
## Known Problems
|
||||||
|
|
||||||
|
|||||||
@ -43,9 +43,9 @@
|
|||||||
"test:lint": "npm run test:lint:eslint && npm run test:lint:remark",
|
"test:lint": "npm run test:lint:eslint && npm run test:lint:remark",
|
||||||
"test:lint:eslint": "eslint --ext .vue,.ts,.tsx,.js,.jsx,.json,.yml,.yaml --max-warnings 0 --ignore-path .gitignore .",
|
"test:lint:eslint": "eslint --ext .vue,.ts,.tsx,.js,.jsx,.json,.yml,.yaml --max-warnings 0 --ignore-path .gitignore .",
|
||||||
"test:lint:remark": "remark . --quiet --frail",
|
"test:lint:remark": "remark . --quiet --frail",
|
||||||
"test:unit": "vitest",
|
"test:unit": "npm run test:unit:dev -- run --coverage",
|
||||||
"test:unit:coverage": "npm run test:unit -- run --coverage",
|
"test:unit:dev": "vitest",
|
||||||
"test": "npm run test:lint && npm run test:unit:coverage",
|
"test": "npm run test:lint && npm run test:unit",
|
||||||
"docs:dev": "vuepress dev .",
|
"docs:dev": "vuepress dev .",
|
||||||
"docs:build": "vuepress build ."
|
"docs:build": "vuepress build ."
|
||||||
},
|
},
|
||||||
|
|||||||
@ -12,10 +12,10 @@ export default mergeConfig(
|
|||||||
coverage: {
|
coverage: {
|
||||||
all: true,
|
all: true,
|
||||||
include: ['src/**/*.{js,jsx,ts,tsx,vue}'],
|
include: ['src/**/*.{js,jsx,ts,tsx,vue}'],
|
||||||
lines: 5.81,
|
lines: 5,
|
||||||
functions: 0,
|
functions: 0,
|
||||||
branches: 11.11,
|
branches: 10,
|
||||||
statements: 5.81,
|
statements: 5,
|
||||||
// 100: true,
|
// 100: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user