ci(workflow): add dependency install step after base image changes an… #19
This file contains hidden or 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: Test (and publish if on main) | |
| on: | |
| push: | |
| branches: '*' | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| quality-check: | |
| name: Lint, Test and Build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| container: | |
| - node:18-bullseye | |
| - node:20-bullseye | |
| - node:22-bullseye | |
| - node:lts-bullseye | |
| container: ${{ matrix.container }} | |
| steps: | |
| - name: Cloning GitHub Repository | |
| uses: actions/checkout@v3 | |
| - name: Install system dependencies for Playwright | |
| run: | | |
| apt-get update | |
| apt-get install -y wget gnupg ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libcups2 libdbus-1-3 libdrm2 libgbm1 libnspr4 libnss3 libxcomposite1 libxdamage1 libxrandr2 xdg-utils libxshmfence1 libxss1 libxtst6 libu2f-udev | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| run: npx playwright install | |
| - name: Run linter | |
| run: npm run lint | |
| - name: Run tests | |
| run: npm run test | |
| - name: Build package | |
| run: npm run build | |
| publish: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| needs: [quality-check] | |
| steps: | |
| - name: Cloning GitHub Repository | |
| uses: actions/checkout@v3 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Release | |
| run: npm run semantic-release | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }} |