Skip to content

Commit

Permalink
chore(react-core): enable cypress component testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed May 29, 2024
1 parent 894c8bf commit 8754541
Show file tree
Hide file tree
Showing 14 changed files with 3,083 additions and 1,703 deletions.
16 changes: 16 additions & 0 deletions .github/actions/test-component/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Components tests
description: verify component tests
runs:
using: "composite"
steps:
- uses: nrwl/nx-set-shas@v4
- uses: './.github/actions/node-cache'
- uses: './.github/actions/cypress-cache'
- uses: './.github/actions/webpack-cache'
- name: Install deps
shell: bash
run: npm i
- name: Test affected
shell: bash
run: npx nx affected -t component-test --configuration=ci

10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ jobs:
with:
fetch-depth: 0
- uses: './.github/actions/test-unit'
test-component:
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: './.github/actions/test-component'
build:
runs-on: ubuntu-latest
needs: [install]
Expand All @@ -59,7 +67,7 @@ jobs:
- uses: './.github/actions/test-e2e'
release:
runs-on: ubuntu-latest
needs: [install, lint, test, build, test-e2e]
needs: [install, lint, test, build, test-e2e, test-component]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
Expand Down
16 changes: 9 additions & 7 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
},
"lint": {
"cache": true,
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.json",
"{workspaceRoot}/.eslintignore",
"{workspaceRoot}/eslint.config.js"
]
"inputs": ["default", "{workspaceRoot}/.eslintrc.json", "{workspaceRoot}/.eslintignore", "{workspaceRoot}/eslint.config.js"]
},
"e2e": {
"cache": true,
Expand All @@ -34,6 +29,10 @@
},
"version": {
"dependsOn": ["^version"]
},
"component-test": {
"cache": true,
"inputs": ["default", "^production"]
}
},
"namedInputs": {
Expand All @@ -46,7 +45,10 @@
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/src/test-setup.[jt]s",
"!{projectRoot}/test-setup.[jt]s"
"!{projectRoot}/test-setup.[jt]s",
"!{projectRoot}/cypress/**/*",
"!{projectRoot}/**/*.cy.[jt]s?(x)",
"!{projectRoot}/cypress.config.[jt]s"
],
"sharedGlobals": []
},
Expand Down
Loading

0 comments on commit 8754541

Please sign in to comment.