Merge pull request #4 from IT4Change/workflow-build

feat(workflow): build test workflow
This commit is contained in:
Ulf Gebhardt 2023-11-20 16:44:24 +01:00 committed by GitHub
commit 3bb89e5b4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 73 additions and 45 deletions

View File

@ -5,3 +5,6 @@ frontend-test-lint-code: &frontend-test-lint-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
View 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

View File

@ -9,7 +9,7 @@ jobs:
name: Detect File Changes - frontend-test-lint-code
runs-on: ubuntu-latest
outputs:
frontend-test-lint-code: ${{ steps.changes.outputs.frontend-test-lint-code }}
changes: ${{ steps.changes.outputs.frontend-test-lint-code }}
steps:
- uses: actions/checkout@v3.3.0
@ -22,7 +22,7 @@ jobs:
list-files: shell
lint:
if: needs.files-changed.outputs.frontend-test-lint-code == 'true'
if: needs.files-changed.outputs.changes == 'true'
name: Lint - Frontend
needs: files-changed
runs-on: ubuntu-latest

View File

@ -7,8 +7,8 @@ on:
- edited
- synchronize
permissions:
pull-requests: write
permissions: write-all
# pull-requests: write
jobs:
main:

View File

@ -9,7 +9,7 @@ jobs:
name: Detect File Changes - frontend-test-unit-code
runs-on: ubuntu-latest
outputs:
frontend-test-unit-code: ${{ steps.changes.outputs.frontend-test-unit-code }}
changes: ${{ steps.changes.outputs.frontend-test-unit-code }}
steps:
- uses: actions/checkout@v3.3.0
@ -22,7 +22,7 @@ jobs:
list-files: shell
unit:
if: needs.files-changed.outputs.frontend-test-unit-code == 'true'
if: needs.files-changed.outputs.changes == 'true'
name: Unit - Frontend
needs: files-changed
runs-on: ubuntu-latest

View File

@ -30,7 +30,7 @@ This projects utilizes `storybook` to develop frontend components and `vuepress`
The following commands are available:
| Command | Description |
|------------------------------|-------------------------------------------------|
|----------------------------|-------------------------------------------------|
| `npm install` | Project setup |
| `npm run build` | Compiles and minifies for production |
| `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:eslint` | Run linter eslint |
| `npm run test:lint:remark` | Run linter remark |
| `npm run test:unit` | Run all unit tests in watch mode |
| `npm run test:unit:coverage` | Run all unit tests and generate coverage report |
| `npm run test:unit` | 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 |
| **Storybook** | |
| `npm run storybook` | Run Storybook |
@ -76,20 +76,11 @@ The following endpoints are provided given the right command is executed or all
## 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
- [ ] chromatic
- [ ] github actions
- [ ] lint locales
- [ ] zähler -> pinia
## Known Problems

View File

@ -43,9 +43,9 @@
"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:remark": "remark . --quiet --frail",
"test:unit": "vitest",
"test:unit:coverage": "npm run test:unit -- run --coverage",
"test": "npm run test:lint && npm run test:unit:coverage",
"test:unit": "npm run test:unit:dev -- run --coverage",
"test:unit:dev": "vitest",
"test": "npm run test:lint && npm run test:unit",
"docs:dev": "vuepress dev .",
"docs:build": "vuepress build ."
},

View File

@ -12,10 +12,10 @@ export default mergeConfig(
coverage: {
all: true,
include: ['src/**/*.{js,jsx,ts,tsx,vue}'],
lines: 5.81,
lines: 5,
functions: 0,
branches: 11.11,
statements: 5.81,
branches: 10,
statements: 5,
// 100: true,
},
},