diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 6f42ab4..eca0223 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -4,4 +4,7 @@ frontend-test-lint-code: &frontend-test-lint-code - '**/*' frontend-test-unit-code: &frontend-test-unit-code + - '**/*' + +frontend-test-build-code: &frontend-test-build-code - '**/*' \ No newline at end of file diff --git a/.github/workflows/test.build.code.yml b/.github/workflows/test.build.code.yml new file mode 100644 index 0000000..f9d59fc --- /dev/null +++ b/.github/workflows/test.build.code.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/test.lint.code.yml b/.github/workflows/test.lint.code.yml index dc728b7..9f79917 100644 --- a/.github/workflows/test.lint.code.yml +++ b/.github/workflows/test.lint.code.yml @@ -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 diff --git a/.github/workflows/test.lint.pr.yml b/.github/workflows/test.lint.pr.yml index 3e6cad4..29ceeb1 100644 --- a/.github/workflows/test.lint.pr.yml +++ b/.github/workflows/test.lint.pr.yml @@ -7,8 +7,8 @@ on: - edited - synchronize -permissions: - pull-requests: write +permissions: write-all +# pull-requests: write jobs: main: diff --git a/.github/workflows/test.unit.code.yml b/.github/workflows/test.unit.code.yml index 47eab92..336c7e3 100644 --- a/.github/workflows/test.unit.code.yml +++ b/.github/workflows/test.unit.code.yml @@ -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 diff --git a/README.md b/README.md index f1bd5c0..b15fa89 100644 --- a/README.md +++ b/README.md @@ -29,28 +29,28 @@ 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 | -| **Develop** | | -| `npm run dev` | Compiles and hot-reloads for development | -| `npm run server:dev` | Run development server | -| **Test** | | -| `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 test` | Run all tests & linters | -| **Storybook** | | -| `npm run storybook` | Run Storybook | -| `npm run storybook:build` | Build static storybook | -| `npm run storybook:test` | Run tests against all storybook stories | -| **Documentation** | | -| `npm run docs:dev` | Run Documentation in development mode | -| `npm run docs:build` | Build static documentation | +| Command | Description | +|----------------------------|-------------------------------------------------| +| `npm install` | Project setup | +| `npm run build` | Compiles and minifies for production | +| `npm run server:prod` | Runs productions server | +| **Develop** | | +| `npm run dev` | Compiles and hot-reloads for development | +| `npm run server:dev` | Run development server | +| **Test** | | +| `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 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 | +| `npm run storybook:build` | Build static storybook | +| `npm run storybook:test` | Run tests against all storybook stories | +| **Documentation** | | +| `npm run docs:dev` | Run Documentation in development mode | +| `npm run docs:build` | Build static documentation | ### Docker @@ -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 diff --git a/package.json b/package.json index e2aae9d..8653004 100644 --- a/package.json +++ b/package.json @@ -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 ." }, diff --git a/vitest.config.ts b/vitest.config.ts index ca3fcd4..3c90839 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -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, }, },