77 - main
88 paths :
99 - ' packages/**'
10- - ' .yarnrc.yml '
11- - ' yarn. lock'
10+ - ' pnpm-workspace.yaml '
11+ - ' pnpm- lock.yaml '
1212 - ' .prettier*'
1313 - ' tsconfig.base.json'
14- - ' .prettier*'
1514 - ' .github/workflows/ci-packages.yml'
1615
1716 pull_request :
2120 - reopened
2221 paths :
2322 - ' packages/**'
24- - ' .yarnrc.yml '
25- - ' yarn. lock'
23+ - ' pnpm-workspace.yaml '
24+ - ' pnpm- lock.yaml '
2625 - ' .prettier*'
2726 - ' tsconfig.base.json'
28- - ' .prettier*'
2927 - ' .github/workflows/ci-packages.yml'
3028
3129env :
@@ -36,87 +34,69 @@ jobs:
3634 runs-on : ubuntu-latest
3735 strategy :
3836 matrix :
39- node-version : [22 .x]
37+ node-version : [24 .x]
4038 steps :
41- - uses : actions/checkout@v4
39+ - uses : actions/checkout@v6
4240 with :
43- # Fetch all git history so that yarn workspaces --since can compare with the correct commits
44- # @link https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
4541 fetch-depth : 0
4642
4743 - name : Use Node.js ${{ matrix.node-version }}
48- uses : actions/setup-node@v4
44+ uses : actions/setup-node@v6
4945 with :
50- node-version : ${{ matrix.node-version }}
46+ # pnpm 11.5+ requires Node >=22.13; setup Node before pnpm/action-setup
47+ node-version : ' 24'
5148
52- # Why not using setup-node 2.2+ cache option (yet) ?
53- # see https://github.com/belgattitude/nextjs-monorepo-example/pull/369
54- - name : Get yarn cache directory path
55- id : yarn-cache-dir-path
56- run : echo "::set-output name=dir::$(yarn config get cacheFolder)"
49+ - name : Setup pnpm
50+ uses : pnpm/action-setup@v6
5751
58- - name : Restore yarn cache
59- uses : actions/cache@v4
60- id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
52+ - name : Cache pnpm store
53+ uses : actions/setup-node@v6
6154 with :
62- path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
63- key : yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
64- restore-keys : |
65- yarn-cache-folder-
55+ node-version : ' 24'
56+ cache : pnpm
6657
6758 - name : Restore packages cache
68- uses : actions/cache@v4
59+ uses : actions/cache@v5
6960 with :
7061 path : |
7162 ${{ github.workspace }}/.cache
7263 ${{ github.workspace }}/**/tsconfig.tsbuildinfo
73-
74- key : ${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/**.[jt]sx?', 'packages/**.json') }}
64+ key : ${{ runner.os }}-packages-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('packages/**.[jt]sx?', 'packages/**.json') }}
7565 restore-keys : |
76- ${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn. lock') }}-
66+ ${{ runner.os }}-packages-cache-${{ hashFiles('**/pnpm- lock.yaml ') }}-
7767
7868 - name : Install dependencies
79- run : |
80- yarn install --immutable --inline-builds
69+ run : pnpm install --frozen-lockfile
8170 env :
8271 HUSKY : 0
8372
84- # Typecheck packages that have changed + packages and apps that depends on them (--from & --since)
85- # That allows to see if we're introducing "surface" regressions (just the types)
73+ # pnpm unions multiple --filter flags (OR). Limit to changed packages under packages/
74+ # (yarn: workspaces foreach --include '@events-helsinki/*' --since=origin/main).
8675 - name : Typecheck
87- run : |
88- yarn workspaces foreach -tv --from '@events-helsinki/*' --since=origin/main --recursive run typecheck
76+ run : pnpm --filter '[origin/main]' --filter '!{apps/**}' --filter '!{proxies/**}' --filter '!events-helsinki-monorepo' run typecheck
8977
90- # Lint packages that have changed (--include & --since)
9178 - name : Linter
9279 run : |
93- yarn workspaces foreach -tv --include '@events-helsinki/* ' --since=origin/main --recursive run lint
94- yarn workspaces foreach -tv --include '@events-helsinki/* ' --since=origin/main --recursive run lint-styles
80+ pnpm --filter '[origin/main]' --filter '!{apps/**}' --filter '!{proxies/**} ' --filter '!events-helsinki-monorepo' run lint
81+ pnpm --filter '[origin/main]' --filter '!{apps/**}' --filter '!{proxies/**} ' --filter '!events-helsinki-monorepo' --if-present run lint-styles
9582
96- # Test packages that have changed (--include & --since)
9783 - name : Unit tests changed packages
98- run : |
99- yarn workspaces foreach -tv --include '@events-helsinki/*' --since=origin/main --recursive run test --coverage
100- # to debug cache issues: ls ${{ github.workspace }}/.cache
101- # Build packages that have changed (--include & --since), assuming that
102- # apps build are done already. Otherwise --from & --since
84+ run : pnpm --filter '[origin/main]' --filter '!{apps/**}' --filter '!{proxies/**}' --filter '!events-helsinki-monorepo' run test --coverage
85+
10386 - name : Run build for changed packages
104- run : |
105- yarn workspaces foreach -tv --include '@events-helsinki/*' --since=origin/main run build
87+ run : pnpm --filter '[origin/main]' --filter '!{apps/**}' --filter '!{proxies/**}' --filter '!events-helsinki-monorepo' run build
10688
107- # Test storybook build on packages that have changed (--include & --since)
10889 - name : Run storybook build for changed packages
109- run : |
110- yarn workspaces foreach -tv --exclude hobbies-helsinki --exclude events-helsinki --exclude sports-helsinki --since=origin/main run build-storybook
90+ run : pnpm --filter '[origin/main]' --filter '!{apps/**}' --filter '!{proxies/**}' --filter '!events-helsinki-monorepo' run build-storybook
11191
11292 - name : Run tests
11393 working-directory : packages/components
114- run : yarn test:coverage
94+ run : pnpm test:coverage
11595 env :
11696 CI : true
11797
11898 - name : SonarQube Cloud Scan
119- uses : SonarSource/sonarqube-scan-action@v6
99+ uses : SonarSource/sonarqube-scan-action@59db25f34e16620e48ab4bb9e4a5dce155cb5432 # v8.0.0
120100 with :
121101 projectBaseDir : packages/components
122102 env :
0 commit comments