4
4
branches :
5
5
- v2
6
6
7
+ # Ensure scripts are run with pipefail. See:
8
+ # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
9
+ defaults :
10
+ run :
11
+ shell : bash
12
+
7
13
jobs :
8
14
tests :
9
- runs-on : ubuntu-latest
15
+ strategy :
16
+ fail-fast : false
17
+ matrix :
18
+ os :
19
+ - ubuntu-latest
20
+ - windows-latest
21
+ - macos-latest
22
+
23
+ runs-on : ${{ matrix.os }}
24
+
10
25
steps :
11
- # Check out, and set up the node/ruby infra
12
26
- uses : actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
13
27
- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
14
28
with :
15
29
node-version : " 18.x"
30
+ - uses : pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
16
31
17
- # Install, should be basically instant if cached
18
- - run : yarn install
19
- env :
20
- YARN_CHECKSUM_BEHAVIOR : ignore
21
-
22
- # Verify dependencies are hooked up right
23
- - run : node test/verifyPackageVersions.js
32
+ - run : pnpm install
24
33
25
34
# Grab localizations
26
- - run : yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1
35
+ - run : pnpm docs-sync pull microsoft/TypeScript-Website-localizations#main 1
27
36
28
37
# Build the packages
29
- - run : yarn bootstrap
30
- - run : yarn build
38
+ - run : pnpm bootstrap
39
+ - run : pnpm build
31
40
32
41
# Verify it compiles
33
- - run : yarn build-site
42
+ - run : pnpm build-site
34
43
35
44
- uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
36
- if : github.event_name == 'pull_request'
45
+ if : github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
37
46
with :
38
47
name : site
39
48
path : packages/typescriptlang-org/public
40
49
41
50
# Run all the package's tests
42
- - run : yarn test
43
- env :
44
- CI : true
51
+ - run : pnpm test
45
52
46
53
# danger for PR builds
47
- - if : github.event_name == 'pull_request' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id
48
- run : " yarn danger ci"
54
+ - if : github.event_name == 'pull_request' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id && matrix.os == 'ubuntu-latest'
55
+ run : " pnpm danger ci"
49
56
env :
50
57
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
51
58
@@ -69,30 +76,41 @@ jobs:
69
76
name : missing.patch
70
77
path : missing.patch
71
78
72
- windows :
73
- runs-on : windows-latest
74
-
79
+ changesets :
80
+ name : changesets
81
+ runs-on : ubuntu-latest
75
82
steps :
76
- # Check out, and set up the node infra
77
- - uses : actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
78
- - uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
79
- with :
80
- node-version : " 18.x"
83
+ - uses : actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
84
+ with :
85
+ fetch-depth : 0
86
+ - uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
87
+ with :
88
+ node-version : ' lts/*'
89
+ - uses : pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
90
+
91
+ - run : pnpm install
92
+
93
+ - name : Check for missing changesets
94
+ run : |
95
+ PR_CHANGESETS=$(ls .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l)
96
+ MAIN_CHANGESETS=$(git ls-tree -r origin/v2 .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l)
81
97
82
- # Get local dependencies
83
- - run : yarn install
84
- env :
85
- YARN_CHECKSUM_BEHAVIOR : ignore
98
+ # If the PR has no changesets, but main has changesets, assume this is PR is a versioning PR and exit
99
+ if [[ $PR_CHANGESETS -eq 0 && $MAIN_CHANGESETS -gt 0 ]]; then
100
+ echo "This PR is a versioning PR, exiting"
101
+ exit 0
102
+ fi
86
103
87
- - run : yarn bootstrap
88
- - run : yarn build
104
+ # git switch -c changesets-temp
105
+ # git checkout origin/v2 -- <ignored files>
106
+ pnpm changeset status --since=origin/v2
89
107
90
108
required :
91
109
runs-on : ubuntu-latest
92
110
if : ${{ always() }}
93
111
needs :
94
112
- tests
95
- - windows
113
+ - changesets
96
114
97
115
steps :
98
116
- name : Check required jobs
0 commit comments