github workflow added #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_requests: | ||
branches: | ||
- "**" | ||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
node: ["20.x"] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Get npm cache directory | ||
id: npm-cache | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
- name: Node dependency cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.npm-cache.outputs.dir }} | ||
key: ${{ matrix.os }}-node-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
${{ matrix.os }}-node- | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build packages | ||
run: npm run build | ||
- name: Run e2e test with example app | ||
run: node scripts/e2e.js | ||