Version Packages #16363
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: Main workflow | |
| # The event triggers are configured as following: | |
| # - on branch main, trigger the workflow on every push | |
| # - on any pull request, trigger the workflow | |
| # This is to avoid running the workflow twice on pull requests. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| pull-requests: write # Required for size-limit-action to comment on PRs | |
| jobs: | |
| build_lint_and_test: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node (uses version in .nvmrc) | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Get yarn cache | |
| id: yarn-cache | |
| run: echo "::set-output name=dir::$(yarn config get cacheFolder)" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.yarn-cache.outputs.dir }} | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock', 'patches/*.patch') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Check for unmet constraints (fix w/ "yarn constraints --fix") | |
| run: yarn constraints | |
| - name: Building packages | |
| run: yarn build | |
| - name: Running static type checking | |
| run: yarn typecheck | |
| - name: Running linters and tests | |
| run: yarn run jest --projects jest.{eslint,test,ts-test,bundle}.config.js --reporters github-actions | |
| env: | |
| CI: true | |
| - name: Building Visual Regression Tests application for UI components | |
| run: yarn visual-testing-app:build | |
| - name: Running Visual Regression Tests for UI components | |
| # aa-exec: | |
| # ubuntu-24.04, the image used for `ubuntu-latest` as of Oct 14 2024(https://github.com/actions/runner-images/issues/10636), | |
| # introduced security measures in its app-armor security (https://github.com/puppeteer/puppeteer/issues/12818#issuecomment-2247844464) | |
| # that made it so that puppeteers chromium installation is not whitelisted, | |
| # which made it so that the chromium sandbox is not available and puppeteer errors out, | |
| # so we need to specify that we are using app armor's chrome profile when running puppeteer (https://github.com/mermaid-js/mermaid-cli/issues/730#issuecomment-2408615110) | |
| run: aa-exec --profile=chrome -- yarn vrt:components | |
| timeout-minutes: 20 | |
| env: | |
| PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | |
| - name: Set bundlewatch environment variables | |
| id: bundlewatch | |
| run: | | |
| echo "repo_name=$(echo '${{ github.repository }}' | cut -d'/' -f2)" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Checking bundle size | |
| run: yarn bundlesize | |
| env: | |
| BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }} | |
| CI_REPO_OWNER: ${{ github.repository_owner }} | |
| CI_REPO_NAME: ${{ steps.bundlewatch.outputs.repo_name }} | |
| CI_COMMIT_SHA: ${{ github.sha }} | |
| CI_BRANCH: ${{ github.ref_name }} | |
| CI_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} |