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-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 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

View File

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

View File

@ -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

View File

@ -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

View File

@ -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 ."
}, },

View File

@ -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,
}, },
}, },