Skip to content

Transition to Yarn Workspaces #16

Transition to Yarn Workspaces

Transition to Yarn Workspaces #16

Workflow file for this run

name: New Workflow
permissions:
contents: read
on:
pull_request:
branches:
- master
jobs:
find-packages:
name: Get information about the packages within the repository
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Install action packages
run: yarn workspaces focus @sourceacademy/modules-github-actions
- name: Build actions
run: |
cd ./.github/actions
yarn build
- name: Get Package Information
id: info
uses: ./.github/actions/src/info
outputs:
bundles: ${{ steps.info.outputs.bundles }}
tabs: ${{ steps.info.outputs.tabs }}
libs: ${{ steps.info.outputs.libs }}
tabs:
name: Do work with the tabs
runs-on: ubuntu-latest
needs: find-packages
strategy:
matrix:
tabInfo: ${{ fromJson(needs.find-packages.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 ${{ matrix.tabInfo.name }}
- name: Build Tab
run: yarn workspaces foreach -A --include ${{ matrix.tabInfo.name }} run build
- name: Run Auxillary Tasks
if: matrix.tabInfo.changes == 'true'
run: |
cd ${{ matrix.tabInfo.directory }}
yarn tsc
yarn lint