-
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.
Setup GitHub Actions workflow for formatting, linting, and typechecki…
…ng (#17)
- Loading branch information
1 parent
a6399f7
commit fef59d9
Showing
13 changed files
with
2,117 additions
and
827 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,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
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,93 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
env: | ||
NODE_VERSION: 20 | ||
PNPM_VERSION: 8 | ||
|
||
# Find a workaround to this. | ||
DATABASE_URL: "postgresql://admin:admin@localhost:5432/cooper?schema=public" | ||
NEXTAUTH_URL: "localhost:3000" | ||
|
||
jobs: | ||
lint: | ||
name: Run Eslint And Prettier | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Code Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
run_install: false | ||
|
||
- name: Get pnpm Store Directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- name: Setup pnpm Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install Dependencies | ||
run: pnpm install | ||
|
||
- name: Code Linting | ||
run: pnpm run lint | ||
|
||
- name: Code Formatting | ||
run: pnpm run format:check | ||
|
||
tsc: | ||
name: Run Typescript Compiler | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Code Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
run_install: false | ||
|
||
- name: Get pnpm Store Directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- name: Setup pnpm Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install Dependencies | ||
run: pnpm install | ||
|
||
- name: Code Typechecking | ||
run: pnpm tsc |
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
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
Oops, something went wrong.