Skip to content

Commit

Permalink
build: move e2e command to nx (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhwhite authored Feb 11, 2023
2 parents 9271f03 + 1757313 commit 3463bc8
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ jobs:
--configuration=ci
- name: End to End Tests
run: |
npx playwright install --with-deps
npm run e2e -- --browser=all
npx nx affected \
--base="${{ env.NX_BASE }}" \
--head="${{ env.NX_HEAD }}" \
--targets=e2e
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Release Please
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v2
- uses: google-github-actions/release-please-action@v3.1.2
id: release
with:
release-type: node
Expand All @@ -35,25 +35,25 @@ jobs:
]
- name: Checkout
uses: actions/checkout@v3
if: steps.release.outputs.releases_created
if: steps.release.outputs.release_created
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
registry-url: 'https://registry.npmjs.org'
if: steps.release.outputs.releases_created
if: steps.release.outputs.release_created
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ env.node_version }}-${{ hashFiles('**/package-lock.json') }}
if: steps.release.outputs.releases_created
if: steps.release.outputs.release_created
- name: Install
run: npm ci
if: steps.release.outputs.releases_created && steps.cache-node-modules.outputs.cache-hit != 'true'
if: steps.release.outputs.release_created && steps.cache-node-modules.outputs.cache-hit != 'true'
- name: Publish to NPM
if: steps.release.outputs.releases_created
if: steps.release.outputs.release_created
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
Expand Down
4 changes: 1 addition & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ set -ex
npx pretty-quick --staged
npx nx workspace-lint
npx nx format:check
npx nx affected --targets=lint,build,test --configuration=ci
npx playwright install --with-deps
npm run e2e -- --browser=all
npx nx affected --targets=lint,build,test,e2e --configuration=ci
18 changes: 17 additions & 1 deletion apps/e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@
"options": {
"lintFilePatterns": ["apps/e2e/**/*.ts", "apps/e2e/**/*.html"]
}
},
"e2e": {
"dependsOn": [
{ "target": "build", "projects": "dependencies" },
{ "target": "build", "projects": "self" }
],
"executor": "nx:run-commands",
"outputs": [],
"options": {
"commands": [
"npx playwright install --with-deps",
"npx playwright test -c apps/e2e/playwright.config.ts --browser=all"
],
"parallel": false
}
}
}
},
"implicitDependencies": ["ng-keyboard-sort"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test": "nx test ng-keyboard-sort --browsers=ChromeHeadless --code-coverage --watch=false",
"test:e2e": "nx test e2e --browsers=ChromeHeadless --code-coverage --watch=false",
"test:all": "nx affected:test --all --browsers=ChromeHeadless --code-coverage --watch=false",
"e2e": "playwright test -c apps/e2e/playwright.config.ts",
"e2e": "nx run-many --target=e2e --all",
"lint": "nx run-many --target=lint --all --parallel",
"commit": "cz",
"prepare": "husky install"
Expand Down

0 comments on commit 3463bc8

Please sign in to comment.