-
Notifications
You must be signed in to change notification settings - Fork 28
81 lines (65 loc) 路 2.62 KB
/
Copy pathmain.yml
File metadata and controls
81 lines (65 loc) 路 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- name: Install pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- name: Setup Node (uses version in .nvmrc)
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version-file: '.nvmrc'
- name: Get pnpm store
id: pnpm-store
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: ${{ steps.pnpm-store.outputs.dir }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml', 'patches/*.patch') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check for unmet constraints
run: node scripts/check-workspace-constraints.js
- name: Building packages
run: pnpm build
- name: Running static type checking
run: pnpm typecheck
# Gates phantom-dep regressions introduced by pnpm's shamefully-hoist
# posture (see FEC-924 risk #4). Runs publint per published package
# against the packed tarball; fails on any publint error.
- name: Running publint check
run: pnpm lint:publint
- name: Running linters and tests
run: pnpm jest --projects jest.{eslint,test,ts-test,bundle}.config.js --reporters github-actions
env:
CI: true
- 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: pnpm bundlewatch
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 }}