Skip to content

Commit

Permalink
ci: improve filters thx yarn 4.0.0-rc.42 (#3588)
Browse files Browse the repository at this point in the history
* ci: improve filters thx yarn 4.0.0-rc.42

* ci: improve filters thx yarn 4.0.0-rc.42

* ci: improve filters thx yarn 4.0.0-rc.42

* ci: improve filters thx yarn 4.0.0-rc.42
  • Loading branch information
belgattitude authored Mar 30, 2023
1 parent 37c21a9 commit 322d71a
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 91 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/ci-codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ name: CI-codegen-sync

on:
push:
branches:
- dev
- main

branches: [dev, main]
pull_request:
types:
- opened
- synchronize
- reopened
types: [opened, synchronize, reopened]

jobs:
codegen:
Expand All @@ -22,6 +16,7 @@ jobs:
- uses: actions/checkout@v3
with:
# Fetch all git history so that yarn workspaces --since can compare with the correct commits
# base branches are defined in yarnrc.yml
# @link https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
fetch-depth: 0

Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/ci-e2e-nextjs-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: CI-e2e-nextjs-app

on:
push:
branches:
- dev
- main
branches: [dev, main]
# Only consider those paths to trigger the action
paths:
- 'apps/nextjs-app/**'
Expand All @@ -15,10 +13,7 @@ on:
- '.github/**'

pull_request:
types:
- opened
- synchronize
- reopened
types: [opened, synchronize, reopened]
# Only consider those paths to trigger the action
paths:
- 'apps/nextjs-app/**'
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/ci-e2e-prisma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: CI-e2e-prisma

on:
push:
branches:
- dev
- main
branches: [dev, main]
paths:
- 'packages/db-main-prisma'
- 'package.json'
Expand All @@ -13,10 +11,7 @@ on:
- '.github/**'

pull_request:
types:
- opened
- synchronize
- reopened
types: [opened, synchronize, reopened]
paths:
- 'packages/db-main-prisma'
- 'package.json'
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/ci-monorepo-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@ name: CI-monorepo-integrity

on:
push:
branches:
- dev
- main
branches: [dev, main]
paths:
- 'package.json'
- '*.lock'
- '.yarnrc.yml'
- '.github/**'

pull_request:
types:
- opened
- synchronize
- reopened
types: [opened, synchronize, reopened]
paths:
- 'package.json'
- '*.lock'
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/ci-nextjs-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: CI-nextjs-app

on:
push:
branches:
- dev
- main
branches: [dev, main]
# Only consider those paths to trigger the action
paths:
- 'apps/nextjs-app/**'
Expand All @@ -17,10 +15,7 @@ on:
- '.github/**'

pull_request:
types:
- opened
- synchronize
- reopened
types: [opened, synchronize, reopened]
# Only consider those paths to trigger the action
paths:
- 'apps/nextjs-app/**'
Expand Down
35 changes: 12 additions & 23 deletions .github/workflows/ci-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: CI-packages

on:
push:
branches:
- dev
- main
branches: [dev, main]
paths:
- 'packages/**'
- 'package.json'
Expand All @@ -15,10 +13,7 @@ on:
- '.github/**'

pull_request:
types:
- opened
- synchronize
- reopened
types: [opened, synchronize, reopened]
paths:
- 'packages/**'
- 'package.json'
Expand Down Expand Up @@ -60,29 +55,23 @@ jobs:
restore-keys: |
${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-
# Typecheck packages that have changed + packages and apps that depends on them (--from & --since)
# That allows to see if we're introducing "surface" regressions (just the types)
# Typecheck packages that have changed
- name: 🕵️ Typecheck
run: yarn workspaces foreach -tv --from '@your-org/*' --exclude '*-app' --since=origin/main --recursive run typecheck
run: yarn workspaces foreach -tv --since --include 'packages/*' run typecheck

# Lint packages that have changed (--include & --since)
- name: 🔬 Linter
run: |
yarn workspaces foreach -tv --include '@your-org/*' --exclude '*-app' --since=origin/main --recursive run lint
yarn workspaces foreach -tv --include '@your-org/*' --exclude '*-app' --since=origin/main --recursive run lint-styles
yarn workspaces foreach -tv --since --include 'packages/*' run lint
yarn workspaces foreach -tv --since --include 'packages/*' run lint-styles
# Test packages that have changed (--include & --since)
- name: 🧪 Unit tests changed packages
- name: 🧪 Unit tests
run: |
yarn workspaces foreach -tv --include '@your-org/*' --exclude '*-app' --since=origin/main --recursive run test-unit
# to debug cache issues: ls ${{ github.workspace }}/.cache
# Build packages that have changed (--include & --since), assuming that
# apps build are done already. Otherwise --from & --since
- name: 🏗 Run build for changed packages
yarn workspaces foreach -tv --since --include 'packages/*' run test-unit
- name: 🏗 Run build
run: |
yarn workspaces foreach -tv --include '@your-org/*' --exclude '*-app' --since=origin/main run build
yarn workspaces foreach -tv --since --include 'packages/*' run build
# Test storybook build on packages that have changed (--include & --since)
- name: 🧐 Run storybook build for changed packages
run: |
yarn workspaces foreach -tv --exclude '*-app' --since=origin/main run build-storybook
yarn workspaces foreach -tv --since --include 'packages/*' run build-storybook
9 changes: 2 additions & 7 deletions .github/workflows/ci-remix-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: CI-remix-app

on:
push:
branches:
- dev
- main
branches: [dev, main]
paths:
- 'apps/remix-app/*'
- 'package.json'
Expand All @@ -15,10 +13,7 @@ on:
- '.github/**'

pull_request:
types:
- opened
- synchronize
- reopened
types: [opened, synchronize, reopened]
paths:
- 'apps/remix-app/*'
- 'package.json'
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/ci-vite-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: CI-vite-app

on:
push:
branches:
- dev
- main
branches: [dev, main]
paths:
- 'apps/vite-app/**'
- 'package.json'
Expand All @@ -15,10 +13,7 @@ on:
- '.github/**'

pull_request:
types:
- opened
- synchronize
- reopened
types: [opened, synchronize, reopened]
paths:
- 'apps/vite-app/**'
- 'package.json'
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/clean-up-pr-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Cleanup caches for closed branches

on:
pull_request:
types:
- closed
types: [closed]
workflow_dispatch:

jobs:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/codesee-arch-diagram.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
on:
push:
branches:
- main
branches: [dev, main]
pull_request_target:
types: [opened, synchronize, reopened]

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release-or-version-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: ReleaseOrVersionPR

on:
push:
branches:
- main
branches: [main]

jobs:
release:
Expand Down
2 changes: 0 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
changesetBaseRefs:
- main
- origin/main
- upstream/main

changesetIgnorePatterns:
- '**/*.test.{js,ts}'
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"homepage": "https://github.com/belgattitude/nextjs-monorepo-example",
"repository": "belgattitude/nextjs-monorepo-example",
"scripts": {
"apps:build": "yarn workspaces foreach -ptv --include '*-app' run build",
"apps:clean": "yarn workspaces foreach -ptv --include '*-app' run clean",
"apps:build": "yarn workspaces foreach -ptv --include 'apps/*' run build",
"apps:clean": "yarn workspaces foreach -ptv --include 'apps/*' run clean",
"check:install": "yarn dlx @yarnpkg/[email protected] .",
"check:git-pristine": "./scripts/check-git-pristine.sh",
"check:renovate:config": "docker run -v renovate.json5:/usr/src/app/renovate.json5 -it renovate/renovate renovate-config-validator",
Expand Down Expand Up @@ -54,19 +54,19 @@
"g:lint-staged-files": "lint-staged --allow-empty",
"g:lint-styles": "yarn workspaces foreach -ptv run lint-styles --color",
"g:release": "yarn g:build && changeset publish",
"g:share-static-hardlink": "yarn workspaces foreach -pv --include '*-app' run share-static-hardlink",
"g:share-static-symlink": "yarn workspaces foreach -pv --include '*-app' run share-static-symlink",
"g:share-static-hardlink": "yarn workspaces foreach -pv --include 'apps/*' run share-static-hardlink",
"g:share-static-symlink": "yarn workspaces foreach -pv --include 'apps/*' run share-static-symlink",
"g:test-e2e": "yarn workspaces foreach -tv run test-e2e",
"g:test-unit": "yarn workspaces foreach -ptv run test-unit",
"g:test-unit-jest": "yarn workspaces foreach -ptv run test-unit-jest",
"g:typecheck": "yarn workspaces foreach -ptv run typecheck",
"install:playwright": "playwright install",
"nuke:node_modules": "npx rimraf@3.0.1 '**/node_modules'",
"packages:build": "yarn workspaces foreach -ptv --include '@your-org/*' run build",
"packages:clean": "yarn workspaces foreach -ptv --include '@your-org/*' run clean",
"packages:lint": "yarn workspaces foreach -ptv --include '@your-org/*' run lint",
"packages:test:unit": "yarn workspaces foreach -ptv --include '@your-org/*' run test-unit",
"packages:typecheck": "yarn workspaces foreach -ptv --include '@your-org/*' run typecheck",
"nuke:node_modules": "rimraf --glob '**/node_modules'",
"packages:build": "yarn workspaces foreach -ptv --include 'packages/*' run build",
"packages:clean": "yarn workspaces foreach -ptv --include 'packages/*' run clean",
"packages:lint": "yarn workspaces foreach -ptv --include 'packages/*' run lint",
"packages:test:unit": "yarn workspaces foreach -ptv --include 'packages/*' run test-unit",
"packages:typecheck": "yarn workspaces foreach -ptv --include 'packages/*' run typecheck",
"postinstall": "is-ci || yarn husky install"
},
"dependencies": {
Expand Down

2 comments on commit 322d71a

@vercel
Copy link

@vercel vercel bot commented on 322d71a Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

monorepo-nextjs-app – ./apps/nextjs-app

monorepo-nextjs-app-belgattitude.vercel.app
monorepo-nextjs-app.vercel.app
monorepo-nextjs-app-git-main-belgattitude.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 322d71a Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

monorepo-vite-app – ./apps/vite-app

monorepo-vite-app-belgattitude.vercel.app
monorepo-vite-app-git-main-belgattitude.vercel.app
monorepo-vite-app.vercel.app

Please sign in to comment.