-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: setup and configure github actions (#25)
* ci: add push and pull-request workflows * ci: remove branch filter in push workflow * ci: fix setup cache-dependency-path * ci: fix pnpm install working-directory * chore: update pnpm-lock.yml * feat: start dashboard or execute cli when provided with a command * ci: export and store graphql schema + nextjs caching * ci: add missing shell property * ci: use correct working-directory to run dashboard * ci: use correct working-directory to run dashboard * chore: add relay build to root build command * chore: fix `artifactDirectory` does not exist at `src/__generated__` * chore: add giantnodes/[email protected] to resolve type issues * chore: fix eslint issues * ci: fix cache restoring after nextjs was built * ci: fix next build due to failed to parse URL from undefined/graphql * ci: fix cache running after install step * ci: fix next build due to failed to parse URL from undefined/graphql * build: force pages to be dynamic * build: set next revalidate to 0 to prevent build time fetching * build: add force dynamic to page layouts * build: remove redundant force-dynamic exports * ci: reorder steps and comment out testing step
- Loading branch information
1 parent
29848f4
commit 55d9c6b
Showing
24 changed files
with
1,963 additions
and
462 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: "🔺️ " | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "🔺️ Cache (store directory)" | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- name: "🔺️ Cache" | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: "📄 " | ||
|
||
inputs: | ||
working-directory: | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "📄 Build GraphQL Schema" | ||
shell: bash | ||
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "💽️ " | ||
|
||
inputs: | ||
node-version: | ||
default: "20" | ||
description: "🔢 Node version" | ||
required: true | ||
pnpm-version: | ||
default: "8" | ||
description: "🔢 pnpm version" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "🔧 pnpm" | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: ${{ inputs.pnpm-version }} | ||
|
||
- name: "💽️ Node ${{ inputs.node-version }}" | ||
uses: actions/setup-node@v4 | ||
with: | ||
registry-url: "https://registry.npmjs.org" | ||
node-version: ${{ inputs.node-version }} | ||
cache: "pnpm" | ||
cache-dependency-path: ./app/pnpm-lock.yaml |
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: "🔀 Pull Request" | ||
|
||
on: | ||
pull_request_target: | ||
|
||
concurrency: | ||
group: pull-request-${{ github.event.pull_request.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
infrastructure: | ||
name: "👷️ CI (Infrastructure)" | ||
timeout-minutes: 20 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "🐙️ Checkout" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "💽️ Setup" | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: "8.0.x" | ||
|
||
- name: "🧪 Test" | ||
run: dotnet test --verbosity quiet | ||
working-directory: ./src/Infrastructure | ||
|
||
dashboard: | ||
name: "👷️ CI (Dashboard)" | ||
timeout-minutes: 20 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "🐙️ Checkout" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "💽️ Setup" | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: "8.0.x" | ||
|
||
- name: "🧪 Test" | ||
run: dotnet test --verbosity quiet | ||
working-directory: ./src/Service.Dashboard | ||
|
||
- name: "⬆️ GraphQL Schema (upload)" | ||
uses: ./.github/actions/schema | ||
with: | ||
working-directory: src/Service.Dashboard/src/HttpApi | ||
|
||
encoder: | ||
name: "👷️ CI (Encoder)" | ||
timeout-minutes: 20 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "🐙️ Checkout" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "💽️ Setup" | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: "8.0.x" | ||
|
||
- name: "🧪 Test" | ||
run: dotnet test --verbosity quiet | ||
working-directory: ./src/Service.Encoder | ||
|
||
app: | ||
name: "👷️ CI (App)" | ||
timeout-minutes: 20 | ||
runs-on: ubuntu-latest | ||
needs: [dashboard] | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: "🐙️ Checkout" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "💽️ Setup" | ||
uses: ./.github/actions/setup | ||
|
||
- name: "🔺️ Cache (pnpm)" | ||
uses: ./.github/actions/cache | ||
|
||
- name: "📦 Install" | ||
shell: bash | ||
working-directory: ./app | ||
run: | | ||
pnpm install --frozen-lockfile | ||
- name: "⬇️ GraphQL Schema (download)" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: schema-${{ github.run_number }}.graphql | ||
path: ./app | ||
|
||
- 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: "🏗️ Build" | ||
working-directory: ./app | ||
shell: bash | ||
run: | | ||
pnpm run build | ||
# - name: "🧪 Test" | ||
# working-directory: ./app | ||
# shell: bash | ||
# run: | | ||
# pnpm run test |
Oops, something went wrong.