Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub action #1

Merged
merged 2 commits into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5

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

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install
run: npm ci
- name: Lint
if: matrix.node-version == '20.x'
run: npm run lint
- name: Types
if: matrix.node-version == '20.x'
run: tsc
- name: Prettier
if: matrix.node-version == '20.x'
run: npm run prettier:check
- name: Test
run: npm test
# N.B.: The selenium server cannot run as a GitHub Actions "service" as
# the tests need to mount local data into the container.
- name: Start Selenium Server
run: |
docker run -d -p 4444:4444 \
--shm-size="2g" \
--name selenium_server \
-v ${PWD}:${PWD} \
selenium/standalone-firefox:4.16.1-20231219
- name: Integration
run: npm run test:integration
- name: Stop Selenium Server
if: always()
run: docker stop selenium_server && docker rm selenium_server
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"postversion": "git push --follow-tags && npm publish",
"prettier:check": "prettier --check '**/*.{js,json,md}'",
"prettier:write": "prettier --write '**/*.{js,json,md}'",
"prepare": "husky install"
"prepare": "husky install && playwright install"
},
"keywords": [
"mocha",
Expand Down