One more time

This commit is contained in:
zomars 2023-02-28 13:00:49 -07:00
parent e8fe71d795
commit fd8b559a13
3 changed files with 23 additions and 3 deletions

View File

@ -15,12 +15,14 @@ runs:
key-1: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock') }} key-1: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock') }}
key-2: ${{ hashFiles('apps/**/**.[jt]s', 'apps/**/**.[jt]sx', 'packages/**/**.[jt]s', 'packages/**/**.[jt]sx', '!**/node_modules') }} key-2: ${{ hashFiles('apps/**/**.[jt]s', 'apps/**/**.[jt]sx', 'packages/**/**.[jt]s', 'packages/**/**.[jt]sx', '!**/node_modules') }}
key-3: ${{ github.event.pull_request.number || github.ref }} key-3: ${{ github.event.pull_request.number || github.ref }}
# Ensures production-build.yml will always be fresh
key-4: ${{ github.sha }}
with: with:
path: | path: |
${{ github.workspace }}/apps/web/.next ${{ github.workspace }}/apps/web/.next
**/.turbo/** **/.turbo/**
**/dist/** **/dist/**
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }} key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-${{ env.key-4 }}
- run: yarn build - run: yarn build
if: steps.cache-build.outputs.cache-hit != 'true' if: steps.cache-build.outputs.cache-hit != 'true'
shell: bash shell: bash

View File

@ -11,7 +11,17 @@ runs:
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: ${{ inputs.node_version }} node-version: ${{ inputs.node_version }}
cache: "yarn" - name: node_modules cache
id: node-modules-cache
uses: actions/cache@v3
env:
cache-name: node-modules-yarn
cache-key: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock', 'packages/prisma/schema.prisma') }}
with:
path: |
**/node_modules/**
packages/prisma/zod
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.cache-key }}
- name: Yarn install - name: Yarn install
shell: bash shell: bash
run: | run: |

View File

@ -37,24 +37,32 @@ jobs:
uses: ./.github/workflows/env-create-file.yml uses: ./.github/workflows/env-create-file.yml
secrets: inherit secrets: inherit
setup:
name: Yarn install & cache
uses: ./.github/workflows/yarn-install.yml
secrets: inherit
type-check: type-check:
name: Type check name: Type check
needs: setup
uses: ./.github/workflows/check-types.yml uses: ./.github/workflows/check-types.yml
secrets: inherit secrets: inherit
test: test:
name: Unit tests name: Unit tests
needs: setup
uses: ./.github/workflows/test.yml uses: ./.github/workflows/test.yml
secrets: inherit secrets: inherit
lint: lint:
name: Linters name: Linters
needs: setup
uses: ./.github/workflows/lint.yml uses: ./.github/workflows/lint.yml
secrets: inherit secrets: inherit
build: build:
name: Production build name: Production build
needs: env needs: [setup, env]
uses: ./.github/workflows/production-build.yml uses: ./.github/workflows/production-build.yml
secrets: inherit secrets: inherit