Skip to content

Commit

Permalink
ci: export and store graphql schema + nextjs caching
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILLIPS71 committed Apr 15, 2024
1 parent 3b93b6e commit 02df5f3
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 37 deletions.
1 change: 0 additions & 1 deletion .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: "🔺️ "
author: "PHILLIPS71"

runs:
using: "composite"
Expand Down
19 changes: 19 additions & 0 deletions .github/actions/schema/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "📄 "

inputs:
working-directory:
required: true

runs:
using: "composite"
steps:
- name: "📄 Build GraphQL Schema"
run: dotnet run -- schema export --output schema.graphql
working-directory: ${{ inputs.working-directory }}

- name: "📄 Upload GraphQL Schema"
uses: actions/upload-artifact@v4
with:
name: schema-${{ github.run_number }}.graphql
path: ${{ inputs.working-directory }}/schema.graphql
retention-days: 1
1 change: 0 additions & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: "💽️ "
author: "PHILLIPS71"

inputs:
node-version:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: "📝 PR Title"

on:
pull_request_target:
branches:
- main

jobs:
main:
Expand Down
47 changes: 26 additions & 21 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: "▶️ Pull Request"
name: "🔀 Pull Request"

on:
pull_request_target:
branches:
- main

concurrency:
group: pull-request-${{ github.event.pull_request.number }}
Expand Down Expand Up @@ -44,6 +42,11 @@ jobs:
run: dotnet test --verbosity quiet
working-directory: ./src/Service.Dashboard

- name: "⬆️ GraphQL Schema (upload)"
uses: ./.github/actions/schema
with:
working-directory: src/Service.Dashboard

encoder:
name: "👷️ CI (Encoder)"
timeout-minutes: 20
Expand Down Expand Up @@ -81,29 +84,31 @@ jobs:
run: |
pnpm install --frozen-lockfile
- name: "🔺️ Cache"
- name: "🔺️ Cache (pnpm)"
uses: ./.github/actions/cache

- name: "⬇️ GraphQL Schema (download)"
uses: actions/download-artifact@v4
with:
name: schema-${{ github.run_number }}.graphql
path: ./app

- name: "🏗️ Build"
working-directory: ./app
shell: bash
run: |
pnpm run build
- name: "🚨️ Lint"
working-directory: ./app
shell: bash
run: |
pnpm run lint
- name: "🦺 Type Check"
working-directory: ./app
shell: bash
run: |
pnpm run type-check
- name: "🧪 Test"
working-directory: ./app
shell: bash
run: |
pnpm run test
- name: "🔺️ Cache (nextjs)"
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/app/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
# - name: "🧪 Test"
# working-directory: ./app
# shell: bash
# run: |
# pnpm run test
31 changes: 19 additions & 12 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
run: dotnet test --verbosity quiet
working-directory: ./src/Service.Dashboard

- name: "⬆️ GraphQL Schema (upload)"
uses: ./.github/actions/schema
with:
working-directory: src/Service.Dashboard

encoder:
name: "👷️ CI (Encoder)"
timeout-minutes: 20
Expand Down Expand Up @@ -79,26 +84,28 @@ jobs:
run: |
pnpm install --frozen-lockfile
- name: "🔺️ Cache"
- name: "🔺️ Cache (pnpm)"
uses: ./.github/actions/cache

- name: "⬇️ GraphQL Schema (download)"
uses: actions/download-artifact@v4
with:
name: schema-${{ github.run_number }}.graphql
path: ./app

- name: "🏗️ Build"
working-directory: ./app
shell: bash
run: |
pnpm run build
- name: "🚨️ Lint"
working-directory: ./app
shell: bash
run: |
pnpm run lint
- name: "🦺 Type Check"
working-directory: ./app
shell: bash
run: |
pnpm run type-check
- name: "🔺️ Cache (nextjs)"
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/app/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: "🧪 Test"
working-directory: ./app
Expand Down

0 comments on commit 02df5f3

Please sign in to comment.