tldraw/.github/workflows/checks.yml
David Sheldrick ca5e268798
check worker bundle sizes (#4032)
This PR aims to make sure #4030 doesn't need to happen again. We check
that the worker file sizes stay within a given limit, and require people
to explicitly up this limit if they decide to add new deps that grow the
bundle size significantly.

### Change Type

<!--  Please select a 'Type' label ️ -->

- [ ] `feature` — New feature
- [ ] `improvement` — Product improvement
- [ ] `api` — API change
- [ ] `bugfix` — Bug fix
- [x] `other` — Changes that don't affect SDK users, e.g. internal or
.com changes


### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Add a brief release note for your PR here.
2024-06-27 13:48:17 +00:00

84 lines
2 KiB
YAML

name: Checks
on:
pull_request:
merge_group:
push:
branches: [main]
env:
CI: 1
PRINT_GITHUB_ANNOTATIONS: 1
defaults:
run:
shell: bash
jobs:
test:
name: 'Tests & checks'
timeout-minutes: 15
runs-on: ubuntu-latest-16-cores-open # TODO: this should probably run on multiple OSes
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: Check version constraints
run: yarn constraints
- name: Check for duplicate dependencies
run: yarn dedupe --check
# Not the most sophisticated way to check for warnings, but I don't think
# Yarn can be convinced to exit with a non-zero exit code on warnings
# see also https://unix.stackexchange.com/a/433713 for the explanation of the parameters
- name: Check for installation warnings
run: 'yarn | grep -vzq "with warnings"'
- name: Check tsconfigs
run: yarn check-tsconfigs
- name: Typecheck
run: yarn build-types
- name: Check scripts
run: yarn check-scripts
- name: Check bundle sizes
run: yarn lazy check-bundle-size
- name: Check PR template
run: yarn update-pr-template --check
env:
GH_TOKEN: ${{ github.token }}
- name: Lint
run: yarn lint
- name: Check API declarations and docs work as intended
run: yarn api-check
- name: Test
run: yarn test-ci
build:
name: 'Build all projects'
timeout-minutes: 15
runs-on: ubuntu-latest-16-cores-open
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: Build all projects
# the sed pipe makes sure that github annotations come through without
# turbo's prefix
run: "yarn build | sed -E 's/^.*? ::/::/'"
- name: Pack public packages
run: "yarn lazy pack-tarball | sed -E 's/^.*? ::/::/'"