feature: add monorepo tooling to minimize maintenance #331
Workflow file for this run
This file contains 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: Packages | |
concurrency: | |
group: packages-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- .github/workflows/packages.yml | |
- packages/** | |
- .eslint* | |
- .prettier* | |
- yarn.lock | |
push: | |
branches: [main] | |
paths: | |
- .github/workflows/packages.yml | |
- packages/** | |
- .eslint* | |
- .prettier* | |
- yarn.lock | |
jobs: | |
review: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
package: | |
- snack-babel-standalone | |
- snack-content | |
- snack-eslint-standalone | |
- snack-proxies | |
- snack-require-context | |
- snack-runtime | |
- snack-sdk | |
- snack-term | |
include: | |
- package: snack-babel-standalone | |
local-install: true | |
- package: snack-eslint-standalone | |
local-install: true | |
- package: snack-runtime | |
local-install: true | |
steps: | |
- name: π Setup repository | |
uses: actions/checkout@v3 | |
- name: π Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: yarn | |
- name: π¦ Install monorepo dependencies | |
run: yarn install --frozen-lockfile | |
# When decoupled from the monorepo, make sure to install the local packages | |
- name: π¦ Install local dependencies | |
if: ${{ matrix.local-install }} | |
run: yarn install --frozen-lockfile | |
working-directory: packages/${{ matrix.package }} | |
- name: π Build core packages | |
run: yarn build | |
- name: π¨ Lint package | |
run: yarn lint --max-warnings 0 | |
working-directory: packages/${{ matrix.package }} | |
- name: π§ͺ Test package | |
run: yarn test --ci --maxWorkers 1 | |
working-directory: packages/${{ matrix.package }} | |
- name: π Build package | |
run: yarn build | |
working-directory: packages/${{ matrix.package }} |