Skip to content

Commit

Permalink
Update GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-ignatov committed Sep 5, 2024
1 parent c541d11 commit 7a30f27
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 28 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/browser.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@

name: Browser Tests

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
workflow_dispatch:
branches: [ "*" ]
workflow_dispatch: {}

jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:

# Checkout the repository
- uses: actions/checkout@v3

- name: Setup Node.js 18.x

# Setup Node.js environment (use 18.x and enable caching)
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: npm
node-version: 20.x
cache: 'npm'

- run: npm ci --legacy-peer-deps
# Install dependencies
- name: Install dependencies
run: npm ci --legacy-peer-deps

- run: npm run build --if-present
# Build the project (if there is a build script)
- name: Build the project
run: npm run build --if-present

- run: npm run nightwatch
# Run Nightwatch tests
- name: Run Nightwatch tests
run: npm run test:e2e

30 changes: 17 additions & 13 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@

name: NodeJS Tests

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
workflow_dispatch:
branches: [ "*" ]
workflow_dispatch: {}

jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 18.x, 20.x ]

steps:

# Checkout the repository
- uses: actions/checkout@v3


# Setup Node.js environment (use matrix for different versions)
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache: 'npm'

- run: npm ci --legacy-peer-deps
# Install dependencies
- name: Install dependencies
run: npm ci --legacy-peer-deps

- run: npm run build --if-present
# Build the project (if a build script exists)
- name: Build the project
run: npm run build --if-present

- run: npm test
# Run tests
- name: Run tests
run: npm run cover:unit

# Upload coverage to Coveralls
- name: Coveralls
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"cover": "npm run cover:unit && npm run cover:e2e && npm run cover:report",
"cover:integration": "nyc --silent --no-clean npm run test:integration",
"cover:report": "nyc report --reporter=lcov --reporter=text",
"dev": "nodemon -w src -w test -w rollup.config.mjs -e ts,js -x 'npm run clean && npm run build && npm run cover'",
"nightwatch": "npm run test:e2e"
"dev": "nodemon -w src -w test -w rollup.config.mjs -e ts,js -x 'npm run clean && npm run build && npm run cover'"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.2.3",
Expand Down

0 comments on commit 7a30f27

Please sign in to comment.