Merge pull request #200 from sparksuite/dependabot/npm_and_yarn/test-… #515
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: Main CI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+ | |
- v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+ | |
- v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+ | |
- v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+ | |
pull_request: | |
branches: | |
- master | |
jobs: | |
lint: | |
name: Lint code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: 'yarn' | |
- run: yarn install --frozen-lockfile --prefer-offline | |
- run: yarn lint | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [lts/*, current] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'yarn' | |
- run: yarn install --frozen-lockfile --prefer-offline | |
- run: yarn test | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
verify-website: | |
name: Verify website | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: 'yarn' | |
- run: yarn dev | |
- run: yarn --cwd ./website type-check | |
- run: yarn --cwd ./website build | |
publish: | |
name: Publish to npm | |
runs-on: ubuntu-latest | |
needs: | |
- lint | |
- test | |
- verify-website | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: 'yarn' | |
registry-url: 'https://registry.npmjs.org' | |
- run: yarn install --frozen-lockfile --prefer-offline | |
- run: yarn compile | |
- run: yarn publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
deploy: | |
name: Deploy to GitHub Pages | |
runs-on: ubuntu-latest | |
needs: | |
- lint | |
- test | |
- verify-website | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: 'yarn' | |
registry-url: 'https://registry.npmjs.org' | |
- run: yarn dev | |
- run: yarn --cwd ./website build | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: website/build |