Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
vltansky committed Jul 11, 2024
1 parent 2743e99 commit 8491e40
Showing 1 changed file with 31 additions and 37 deletions.
68 changes: 31 additions & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,42 @@
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
submodules: true
- uses: actions/setup-node@v4
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev librsvg2-dev libxt-dev libxi-dev mesa-utils libgl1-mesa-dev xvfb
- name: Start Xvfb
run: |
/usr/bin/Xvfb :99 -ac &
export DISPLAY=:99
- name: Install dependencies
run: npm install
- name: Build
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies on Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install -y build-essential libgl1-mesa-dri libglapi-mesa \
libglew-dev libglu1-mesa-dev libosmesa6 \
libxi-dev mesa-utils pkg-config
- name: Install node dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Unit tests
run: xvfb-run npm run test:unit
- name: E2e tests
run: xvfb-run npm run test:e2e
- name: Run tests on Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: xvfb-run npm test:unit
- name: Run tests on non-Ubuntu
if: "!startsWith(matrix.os, 'ubuntu')"
run: npm test:unit
- name: Run E2e tests on Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: xvfb-run npm test:e2e
- name: Run E2e tests on non-Ubuntu
if: "!startsWith(matrix.os, 'ubuntu')"
run: npm test:e2e

0 comments on commit 8491e40

Please sign in to comment.