2023-04-21 16:06:21 +00:00
|
|
|
name: Checks
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
merge_group:
|
|
|
|
push:
|
2023-05-30 14:28:56 +00:00
|
|
|
branches: [main]
|
2023-04-21 16:06:21 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
CI: 1
|
|
|
|
PRINT_GITHUB_ANNOTATIONS: 1
|
|
|
|
|
2023-05-09 16:08:38 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2023-04-21 16:06:21 +00:00
|
|
|
jobs:
|
2024-01-16 14:38:05 +00:00
|
|
|
test:
|
|
|
|
name: 'Tests & checks'
|
2023-04-21 16:06:21 +00:00
|
|
|
timeout-minutes: 15
|
2023-04-21 16:18:25 +00:00
|
|
|
runs-on: ubuntu-latest-16-cores-open # TODO: this should probably run on multiple OSes
|
2023-04-21 16:06:21 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2024-01-16 14:38:05 +00:00
|
|
|
- uses: ./.github/actions/setup
|
2023-04-21 16:06:21 +00:00
|
|
|
|
2024-01-29 20:42:06 +00:00
|
|
|
- name: Check version constraints
|
|
|
|
run: yarn constraints
|
|
|
|
|
|
|
|
- name: Check for duplicate dependencies
|
|
|
|
run: yarn dedupe --check
|
|
|
|
|
2024-01-30 11:41:46 +00:00
|
|
|
# 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"'
|
|
|
|
|
use native structuredClone on node, cloudflare workers, and in tests (#3166)
Currently, we only use native `structuredClone` in the browser, falling
back to `JSON.parse(JSON.stringify(...))` elsewhere, despite Node
supporting `structuredClone` [since
v17](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone)
and Cloudflare Workers supporting it [since
2022](https://blog.cloudflare.com/standards-compliant-workers-api/).
This PR adjusts our shim to use the native `structuredClone` on all
platforms, if available.
Additionally, `jsdom` doesn't implement `structuredClone`, a bug [open
since 2022](https://github.com/jsdom/jsdom/issues/3363). This PR patches
`jsdom` environment in all packages/apps that use it for tests.
Also includes a driveby removal of `deepCopy`, a function that is
strictly inferior to `structuredClone`.
### Change Type
<!-- ❗ Please select a 'Scope' label ❗️ -->
- [x] `sdk` — Changes the tldraw SDK
- [x] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff
<!-- ❗ Please select a 'Type' label ❗️ -->
- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [x] `improvement` — Improving existing features
- [x] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
### Test Plan
1. A smoke test would be enough
- [ ] Unit Tests
- [x] End to end tests
2024-03-18 17:16:09 +00:00
|
|
|
- name: Check tsconfigs
|
|
|
|
run: yarn check-tsconfigs
|
|
|
|
|
2023-04-21 16:06:21 +00:00
|
|
|
- name: Typecheck
|
2023-05-02 12:25:26 +00:00
|
|
|
run: yarn build-types
|
2023-04-21 16:06:21 +00:00
|
|
|
|
|
|
|
- name: Check scripts
|
|
|
|
run: yarn check-scripts
|
|
|
|
|
2024-03-12 14:53:57 +00:00
|
|
|
- name: Check PR template
|
|
|
|
run: yarn update-pr-template --check
|
|
|
|
|
2023-04-21 16:06:21 +00:00
|
|
|
- name: Lint
|
|
|
|
run: yarn lint
|
|
|
|
|
|
|
|
- name: Check API declarations and docs work as intended
|
2023-05-02 12:25:26 +00:00
|
|
|
run: yarn api-check
|
2023-04-21 16:06:21 +00:00
|
|
|
|
2024-01-16 14:38:05 +00:00
|
|
|
- name: Test
|
2024-02-14 16:05:59 +00:00
|
|
|
run: yarn test-ci
|
2024-01-16 14:38:05 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-04-21 16:06:21 +00:00
|
|
|
- name: Build all projects
|
|
|
|
# the sed pipe makes sure that github annotations come through without
|
|
|
|
# turbo's prefix
|
2023-05-02 12:25:26 +00:00
|
|
|
run: "yarn build | sed -E 's/^.*? ::/::/'"
|
2023-04-21 16:06:21 +00:00
|
|
|
|
2023-05-30 14:28:56 +00:00
|
|
|
- name: Pack public packages
|
2024-03-11 14:08:04 +00:00
|
|
|
run: "yarn lazy pack-tarball | sed -E 's/^.*? ::/::/'"
|