Skip to content

Commit

Permalink
build: update node.js.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpestov authored May 16, 2024
1 parent d6bcbb1 commit 61dad63
Showing 1 changed file with 47 additions and 19 deletions.
66 changes: 47 additions & 19 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,51 @@ on:
pull_request:
branches: [ "develop" ]
jobs:
ui-chrome-tests:
timeout-minutes: 15
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.12.0-chrome-123.0.6312.86-1-ff-124.0.2-edge-123.0.2420.65-1
options: --user 1001
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Node info
run: node -v

- run: npm ci
- run: npm run build
- run: cp -r dist/ examples/dist/
- run: http-server examples -p 2222 -c-1 --silent --cors
- run: http-server tests/mocks -p 8181 -c-1 --silent --cors
- run: cypress:headless
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/
http-server examples -p 2222 -c-1 --silent --cors
http-server tests/mocks -p 8181 -c-1 --silent --cors
cypress:headless
# - 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

0 comments on commit 61dad63

Please sign in to comment.