Add push event trigger to test.yml (#268) #444
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| # Adding this to trigger the required CI jobs for PRs created by GitHub Actions jobs | |
| workflow_run: | |
| workflows: ['Update Translated Docs', 'Changesets Release'] # these must be the exact names of workflows | |
| types: [completed] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| if: > | |
| github.event_name == 'push' || | |
| github.event_name == 'pull_request' || | |
| (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') | |
| env: | |
| NODE_OPTIONS: "--max_old_space_size=4096" | |
| strategy: | |
| matrix: | |
| # https://nodejs.org/en/about/previous-releases | |
| # Using 24.3.x due to https://github.com/pnpm/pnpm/issues/9743 | |
| node-version: ['20', '22', '24.3.x'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.13.1 | |
| run_install: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build all packages | |
| run: pnpm build | |
| - name: Run linter | |
| run: pnpm lint | |
| - name: Compile examples | |
| run: pnpm -r build-check | |
| - name: Run tests | |
| run: pnpm test |