Add playground to sparrowql #16
Workflow file for this run
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: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
CI: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x, 20.x] | |
mongodb-version: [3.6, '4.0', 4.2, 4.4, '6.0'] | |
name: Node.js ${{ matrix.node-version }}, MongoDB ${{ matrix.mongodb-version }} | |
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 }} | |
- name: Check dependency duplications | |
uses: vazco/open-standards/actions/npm-dependency-duplications/@master | |
- name: Check dependency vulnerabilities | |
uses: vazco/open-standards/actions/npm-dependency-vulnerabilities/@master | |
- name: Start MongoDB | |
uses: supercharge/mongodb-github-action@1.9.0 | |
with: | |
mongodb-version: ${{ matrix.mongodb-version }} | |
- name: Install dependencies | |
run: npm i -g npm@8 --no-audit && npm ci --no-audit | |
- name: Install dependencies in playground | |
run: cd playground && npm ci --no-audit | |
- name: Lint | |
run: npm run lint | |
- name: Test | |
run: npm run coverage -- --no-cache --runInBand | |
- name: Report coverage | |
uses: codecov/codecov-action@v3.1.1 | |
with: | |
fail_ci_if_error: true | |
- name: Build docs | |
run: cd playground && npm run build | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.node-version == '20.x' | |
- name: Deploy docs | |
uses: peaceiris/actions-gh-pages@v3.9.2 | |
with: | |
allow_empty_commit: true | |
force_orphan: true | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./playground/dist | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.node-version == '20.x' |