Skip to content

Commit

Permalink
update package scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dylankelly committed Jul 26, 2023
1 parent c8db336 commit 7db5dcd
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 7 deletions.
42 changes: 39 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ jobs:
${{ runner.os }}-node-${{ github.ref }}
${{ runner.os }}-node-
- run: npm run lint
- run: npm test
- run: npm run test:unit

Cypress:
Integration:
needs: build
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -119,4 +119,40 @@ jobs:
${{ runner.os }}-node-
- name: Cypress run
run: npm run test:cy
run: npm run test:integration-ci

Integration:
needs: build
runs-on: ubuntu-latest
container:
image: docker://cypress/browsers:latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build-artifacts

- name: Extract build artifacts
run: tar -xzf build-artifacts.tar.gz

- name: Restore Cache
uses: actions/cache@v3
with:
path: |
~/.npm
~/.cache
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ github.ref }}
${{ runner.os }}-node-
- name: Cypress run
run: npm run test:integration-ci
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ dist
.DS_Store
coverage

# Cypress
cypress/downloads
cypress/screenshots
cypress/videos

# Local History
.history

Expand Down
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
"version": "0.0.0",
"main": "./nuxt.config.ts",
"scripts": {
"dev": "nuxi prepare & NUXT_PUBLIC_API_URL=http://localhost:3001 API_PORT=3001 nuxi dev .playground",
"build": "nuxi build .playground",
"dev": "nuxi prepare & nuxi dev .playground",
"dev:mock": "NUXT_PUBLIC_API_URL=http://localhost:3001 API_PORT=3001 npm run dev",
"start": "nuxi start .playground",
"start:mock": "NUXT_PUBLIC_API_URL=http://localhost:3001 API_PORT=3001 nuxi start .playground",
"mock": "node mockserver",
"preview": "nuxi preview .playground",
"lint": "eslint .",
"cy:open": "cypress open",
"test": "jest --colors --runInBand --passWithNoTests",
"test:cy": "start-test 'start:cy' 'http-get://localhost:3000/api/tide/site?id=8888' 'cy:open'",
"start:cy": "NUXT_PUBLIC_API_URL=http://localhost:3001 API_PORT=3001 npm run dev"
"cy:open": "cypress open",
"cy:run": "cypress run",
"test:integration": "start-test dev:mock 'http-get://localhost:3000/api/tide/site?id=8888' 'cy:open'",
"test:integration-ci": "start-test start:mock 'http-get://localhost:3000/api/tide/site?id=8888' 'npm run cy:run'"
},
"exports": {
".": "./nuxt.config.ts",
Expand Down

0 comments on commit 7db5dcd

Please sign in to comment.