Skip to content

Commit

Permalink
ci: use internal action to centralize install
Browse files Browse the repository at this point in the history
  • Loading branch information
belgattitude committed Oct 3, 2022
1 parent 8e50221 commit ba894bb
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 176 deletions.
24 changes: 2 additions & 22 deletions .github/workflows/ci-e2e-nextjs-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# Why not using setup-node 2.2+ cache option (yet) ?
# see https://github.com/belgattitude/nextjs-monorepo-example/pull/369
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: 📥 Monorepo install
uses: ./.github/actions/monorepo-install

# see https://github.com/vercel/next.js/pull/27362
- name: Restore nextjs build nextjs-app from cache
Expand All @@ -85,14 +73,6 @@ jobs:
working-directory: packages/db-main-prisma
run: docker-compose -f docker-compose.e2e.yml up --detach ${{ matrix.database }}

- name: Install dependencies
run: |
yarn install --immutable --inline-builds
env:
PRISMA_SKIP_POSTINSTALL_GENERATE: true
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
HUSKY: 0

- name: Create and seed test database
working-directory: packages/db-main-prisma
run: |
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/ci-e2e-prisma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,13 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# Why not using setup-node 2.2+ cache option (yet) ?
# see https://github.com/belgattitude/nextjs-monorepo-example/pull/369
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: 📥 Monorepo install
uses: ./.github/actions/monorepo-install

- name: Start postgresql
working-directory: packages/db-main-prisma
run: docker-compose -f docker-compose.e2e.yml up --detach ${{ matrix.database }}

- name: Install dependencies
run: |
yarn install --immutable --inline-builds
env:
PRISMA_SKIP_POSTINSTALL_GENERATE: true
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
HUSKY: 0

- name: E2E prisma
working-directory: packages/db-main-prisma
run: |
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/ci-monorepo-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# Why not using setup-node 2.2+ cache option (yet) ?
# see https://github.com/belgattitude/nextjs-monorepo-example/pull/369
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: Install dependencies
run: |
yarn install --immutable --inline-builds
env:
PRISMA_SKIP_POSTINSTALL_GENERATE: true
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
HUSKY: 0
- name: 📥 Monorepo install
uses: ./.github/actions/monorepo-install

- name: Check for duplicate dependencies in lock file
run: |
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/ci-nextjs-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# Why not using setup-node 2.2+ cache option (yet) ?
# see https://github.com/belgattitude/nextjs-monorepo-example/pull/369
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: 📥 Monorepo install
uses: ./.github/actions/monorepo-install

# see https://github.com/vercel/next.js/pull/27362
- name: Restore nextjs build nextjs-app from cache
Expand All @@ -73,14 +61,6 @@ jobs:
restore-keys: |
${{ runner.os }}-nextjs-app-${{ hashFiles('**/yarn.lock') }}-
- name: Install dependencies
run: |
yarn install --immutable --inline-builds
env:
PRISMA_SKIP_POSTINSTALL_GENERATE: true
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
HUSKY: 0

- name: Typecheck
working-directory: apps/nextjs-app
run: |
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/ci-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# Why not using setup-node 2.2+ cache option (yet) ?
# see https://github.com/belgattitude/nextjs-monorepo-example/pull/369
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: 📥 Monorepo install
uses: ./.github/actions/monorepo-install

- name: Restore packages cache
uses: actions/cache@v3
Expand All @@ -72,14 +60,6 @@ jobs:
restore-keys: |
${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-
- name: Install dependencies
run: |
yarn install --immutable --inline-builds
env:
PRISMA_SKIP_POSTINSTALL_GENERATE: true
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
HUSKY: 0

# 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)
- name: Typecheck
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/ci-remix-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# Why not using setup-node 2.2+ cache option (yet) ?
# see https://github.com/belgattitude/nextjs-monorepo-example/pull/369
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: Install dependencies
run: |
yarn install --immutable --inline-builds
env:
PRISMA_SKIP_POSTINSTALL_GENERATE: true
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
HUSKY: 0
- name: 📥 Monorepo install
uses: ./.github/actions/monorepo-install

- name: Typecheck
working-directory: apps/remix-app
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/ci-vite-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# Why not using setup-node 2.2+ cache option (yet) ?
# see https://github.com/belgattitude/nextjs-monorepo-example/pull/369
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: Install dependencies
run: |
yarn install --immutable --inline-builds
env:
PRISMA_SKIP_POSTINSTALL_GENERATE: true
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
HUSKY: 0
- name: 📥 Monorepo install
uses: ./.github/actions/monorepo-install

- name: Typecheck
working-directory: apps/vite-app
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/release-or-version-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,8 @@ jobs:
with:
node-version: 16.x

# Why not using setup-node 2.2+ cache option (yet) ?
# see https://github.com/belgattitude/nextjs-monorepo-example/pull/369
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: Install dependencies
run: |
yarn install --immutable --inline-builds
env:
PRISMA_SKIP_POSTINSTALL_GENERATE: true
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
HUSKY: 0
- name: 📥 Monorepo install
uses: ./.github/actions/monorepo-install

# @link https://github.com/changesets/action
- name: Create Release Pull Request
Expand Down

0 comments on commit ba894bb

Please sign in to comment.