Skip to content

Commit

Permalink
build: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpestov committed May 16, 2024
1 parent bb658bd commit a26ded1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 40 deletions.
76 changes: 37 additions & 39 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,47 @@ on:
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [16, 18]
steps:
- uses: actions/checkout@v4
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "dir=$(npm config get cache)" >> "$GITHUB_OUTPUT"
- name: Cache node modules
id: npm-cache
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node${{ matrix.node-version }}-
- name: Cache Cypress binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-cypress-node${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
restore-keys: |
cypress-${{ runner.os }}-cypress-node${{ matrix.node-version }}-
- name: Install dependencies
uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
- name: Run tests
run: |
npm ci
npm run build
cp -r dist/ examples/dist/
node ./node_modules/http-server/bin/http-server examples -p 2222 -c-1 --silent --cors &
npm run test:e2e
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "dir=$(npm config get cache)" >> "$GITHUB_OUTPUT"
- name: Cache node modules
id: npm-cache
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node${{ matrix.node-version }}-
- name: Cache Cypress binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-cypress-node${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
restore-keys: |
cypress-${{ runner.os }}-cypress-node${{ matrix.node-version }}-
- name: Install dependencies
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Run tests
run: |
npm ci
npm run serve:prod &
npm run test:e2e
# - name: Save test video folder
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: video-${{ runner.os }}
# if-no-files-found: error
# path: tests/e2e

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"lint:vue": "eslint --ext .vue src",
"release": "npm run build && npm publish",
"serve:dev": "vite",
"serve:prod": "npm run build && ncp dist/ examples/dist/ && http-server examples -p 2222 -c-1 --silent --cors",
"serve:prod": "npm run build & ncp dist/ examples/dist/ & http-server examples -p 2222 -c-1 --silent --cors",
"serve:mock-api": "http-server tests/mocks -p 8181 -c-1 --silent --cors",
"test:e2e": "start-server-and-test serve:mock-api 8181 cypress:headless",
"write-changelog": "standard-version"
Expand Down

0 comments on commit a26ded1

Please sign in to comment.