Skip to content

Commit

Permalink
Merge pull request #5 from k2works/develop
Browse files Browse the repository at this point in the history
Take04 非機能要件
  • Loading branch information
k2works authored Dec 29, 2024
2 parents 6837115 + f5eee12 commit d1b28c0
Show file tree
Hide file tree
Showing 567 changed files with 51,403 additions and 6,800 deletions.
46 changes: 42 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
distribution: 'temurin'
- name: Grant execute permission for Gradle wrapper
run: chmod +x ./gradlew
working-directory: api
working-directory: app/backend/api
- name: Build with Gradle in api directory
run: ./gradlew build -x test -x jigReports
working-directory: api
working-directory: app/backend/api

test:
runs-on: ubuntu-latest
Expand All @@ -34,7 +34,45 @@ jobs:
distribution: 'temurin'
- name: Grant execute permission for Gradle wrapper
run: chmod +x ./gradlew
working-directory: api
working-directory: app/backend/api
- name: Test with Gradle in api directory
run: ./gradlew test
working-directory: api
working-directory: app/backend/api

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Grant execute permission for Gradle wrapper
run: chmod +x ./gradlew
working-directory: app/backend/api

- name: Gradle build
run: ./gradlew clean build jacocoTestReport
working-directory: app/backend/api

- name: Download and set up Code Climate Test Reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
working-directory: app/backend/api

- name: Set jacoco.xml path for code climate
env:
JACOCO_SOURCE_PATH: src/main/java
run: ./cc-test-reporter format-coverage ./build/reports/jacoco/test/jacocoTestReport.xml --input-type jacoco
working-directory: app/backend/api

- name: Upload code climate report
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./cc-test-reporter upload-coverage -r $CC_TEST_REPORTER_ID
working-directory: app/backend/api
if: success()

19 changes: 19 additions & 0 deletions .github/workflows/heroku_backend_develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Heroku Backend Develop Deployment

on:
push:
branches-ignore:
- main

jobs:
deploy:
runs-on: ubuntu-22.04
environment: development
steps:
- uses: actions/checkout@v2
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{secrets.HEROKU_APP_DEVELOP_NAME}}
heroku_email: ${{secrets.HEROKU_EMAIL}}
appdir: "app/backend/api" # <- This will point to the api folder in your project
19 changes: 19 additions & 0 deletions .github/workflows/heroku_backend_production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Heroku Backend Production Deployment

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-22.04
environment: production
steps:
- uses: actions/checkout@v2
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{secrets.HEROKU_APP_NAME}}
heroku_email: ${{secrets.HEROKU_EMAIL}}
appdir: "app/backend/api" # <- This will point to the api folder in your project
65 changes: 55 additions & 10 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,76 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI
name: Node.js CI with Npm in frontend directory

on:
push:
branches: [ "main" ]
branches: [ '*' ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 19.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
working-directory: app/frontend
- run: npm run build --if-present
- run: npm test
working-directory: app/frontend

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Use Node.js latest
uses: actions/setup-node@v3
with:
node-version: latest
cache: 'npm'
- run: npm ci
working-directory: app/frontend
- run: npm test
working-directory: app/frontend

e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Grant execute permission for Gradle wrapper
run: chmod +x ./gradlew
working-directory: app/backend/api
- name: Build with Gradle in api directory
run: ./gradlew build -x test
working-directory: app/backend/api
- name: Run with Gradle in api directory
run: ./gradlew bootRun &
working-directory: app/backend/api

- name: Use Node.js latest
uses: actions/setup-node@v3
with:
node-version: latest
cache: 'npm'
- run: npm ci
working-directory: app/frontend
- name: Cypress run
uses: cypress-io/github-action@v5
with:
build: npm run build
start: npm run dev
wait-on: "http://localhost:5173"
working-directory: app/frontend
45 changes: 45 additions & 0 deletions .github/workflows/sonar_qube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: SonarQube
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Grant execute permission for Gradle wrapper
run: chmod +x ./gradlew
working-directory: app/backend/api

- name: Cache SonarQube packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonar --info
working-directory: app/backend/api
29 changes: 29 additions & 0 deletions .github/workflows/vercel_frontend_preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Vercel FrontEnd Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_FRONTEND_PROJECT_ID }}
on:
push:
branches-ignore:
- main
jobs:
deploy:
runs-on: ubuntu-latest
environment: preview
steps:
- uses: actions/checkout@v2
- name: Setup Environment Variables
run: |
echo VITE_APP_API_URL=${{ vars.DEV_APP_API_URL }} > .env
working-directory: app/frontend
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
working-directory: app/frontend
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
working-directory: app/frontend
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
working-directory: app/frontend
29 changes: 29 additions & 0 deletions .github/workflows/vercel_frontend_production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Vercel FrontEnd Production Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_FRONTEND_PROJECT_ID }}
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v2
- name: Setup Environment Variables
run: |
echo VITE_APP_API_URL=${{ vars.PRD_APP_API_URL }} > .env
working-directory: app/frontend
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
working-directory: app/frontend
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
working-directory: app/frontend
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
working-directory: app/frontend
45 changes: 45 additions & 0 deletions .github/workflows/vercel_preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Vercel Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches-ignore:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Start Database Services
uses: hoverkraft-tech/[email protected]
with:
compose-file: "./docker-compose.yml"
services: |
db_postgresql
- name: Setup Graphviz
uses: tlylt/install-graphviz@main
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Grant execute permission for Gradle wrapper
run: chmod +x ./gradlew
working-directory: app/backend/api
- name: Run migrations
run: |
./gradlew assemble
./gradlew flywayMigrate
working-directory: app/backend/api

- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/vercel_productin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Vercel Production Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Start Database Services
uses: hoverkraft-tech/[email protected]
with:
compose-file: "./docker-compose.yml"
services: |
db_postgresql
- name: Setup Graphviz
uses: tlylt/install-graphviz@main
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Grant execute permission for Gradle wrapper
run: chmod +x ./gradlew
working-directory: app/backend/api
- name: Run migrations
run: |
./gradlew assemble
./gradlew flywayMigrate
working-directory: app/backend/api

- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
Loading

0 comments on commit d1b28c0

Please sign in to comment.