This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
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.
- Loading branch information
1 parent
5cd3167
commit 5f016fe
Showing
10 changed files
with
296 additions
and
3 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,129 @@ | ||
name: CI-Backend | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize, reopened] | ||
paths: | ||
- 'backend/**' | ||
|
||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [20] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Generate Prisma Client | ||
run: pnpm --filter backend exec prisma generate | ||
|
||
- name: Build Backend | ||
run: | | ||
pnpm --filter backend build | ||
- name: Cache dist | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./*/dist | ||
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }} | ||
|
||
lint: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [20] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Lint pull request title | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: echo "${{ github.event.pull_request.title }}" | pnpm commitlint --verbose | ||
|
||
- name: Check style | ||
run: pnpm --filter backend format:check | ||
|
||
- name: Lint | ||
run: pnpm --filter backend lint | ||
|
||
test: | ||
runs-on: ${{ matrix.os }} | ||
|
||
env: | ||
DATABASE_URL: postgresql://postgres:1234@localhost:5432/royals?schema=public | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [20] | ||
|
||
services: | ||
postgres: | ||
image: postgres:15-alpine | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: 1234 | ||
POSTGRES_DB: royals | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Check Prisma Migration | ||
run: | | ||
pnpm --filter backend exec prisma migrate diff \ | ||
--from-migrations ./prisma/migrations \ | ||
--to-schema-datamodel ./prisma/schema.prisma \ | ||
--shadow-database-url ${{ env.DATABASE_URL }} \ | ||
--exit-code || | ||
echo "::error::Prisma migration is not up to date. Please run `pnpm prisma migrate dev` locally and commit the changes." | ||
- name: Migrate Prisma | ||
run: pnpm --filter backend exec prisma migrate reset --force | ||
|
||
- name: Check types in Typescript (Backend) | ||
run: pnpm --filter backend exec tsc --noEmit | ||
|
||
- name: Test | ||
run: pnpm --filter backend test |
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,97 @@ | ||
name: CI-Frontend | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize, reopened] | ||
paths: | ||
- 'frontend/**' | ||
|
||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [20] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build Frontend | ||
run: pnpm --filter frontend build | ||
|
||
- name: Cache dist | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./*/dist | ||
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }} | ||
|
||
lint: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [20] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Lint pull request title | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: echo "${{ github.event.pull_request.title }}" | pnpm commitlint --verbose | ||
|
||
- name: Check style | ||
run: pnpm --filter frontend format:check | ||
|
||
- name: Lint | ||
run: pnpm --filter frontend lint | ||
|
||
test: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [20] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Check types in Typescript | ||
run: pnpm --filter frontend exec tsc --noEmit |
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,63 @@ | ||
name: CI-Infra | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize, reopened] | ||
paths: | ||
- 'aws/**' | ||
- 'backend/**' | ||
|
||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
env: | ||
AWS_REGION: ap-northeast-2 | ||
|
||
jobs: | ||
validation: | ||
name: validate terraform | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_GITHUB_ACTION_ROLE }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: 1.5.2 | ||
|
||
- name: Terraform Init | ||
working-directory: ./aws | ||
run: terraform init | ||
|
||
- name: Terraform Validation | ||
working-directory: ./aws | ||
run: terraform validate | ||
|
||
docker-build: | ||
name: build docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: ./backend/Dockerfile | ||
push: false | ||
tags: skku-royals/api:latest |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ node_modules/ | |
*.md | ||
pnpm-lock.yaml | ||
.pnpm-store/ | ||
thunder-tests | ||
.next/ | ||
components.json |
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
Empty file.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
"scripts": { | ||
"lint": "eslint . --ext .js,.ts,.jsx,.tsx", | ||
"format": "prettier --write .", | ||
"format:check": "prettier --check .", | ||
"setup-minio": "ts-node scripts/setup-minio.ts" | ||
}, | ||
"packageManager": "[email protected]", | ||
|