Transition to Yarn Workspaces #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: new-workflow | |
permissions: | |
contents: read | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
load-packages: | |
name: Determine the packages present in the repo for the given type | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
type: ['libs', 'bundles', 'tabs'] | |
outputs: | |
libs: ${{ steps.find.outputs.libs }} | |
bundles: ${{ steps.find.outputs.bundles }} | |
tabs: ${{ steps.find.outputs.tabs }} | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v4 | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Use Node.js 💻 | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: yarn | |
- name: Install dependencies | |
run: yarn workspaces focus @sourceacademy/modules-info-action --production | |
- name: Find Packages | |
id: find | |
uses: ./.github/actions/info | |
with: | |
type: ${{ matrix.type }} | |
test-libs: | |
name: Test and Typecheck libraries | |
runs-on: ubuntu-latest | |
needs: load-packages | |
strategy: | |
matrix: | |
package: ${{ fromJson(needs.load-packages.outputs.libs) }} | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v4 | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Use Node.js 💻 | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: yarn | |
- name: Install dependencies | |
run: yarn workspaces focus ${{ matrix.package }} | |
- name: tsc and test | |
run: | | |
yarn tsc | |
yarn test | |