Skip to content

Commit

Permalink
feat: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ramamimu committed Feb 15, 2024
1 parent 9d11dea commit 2bb80ab
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Continue Integration

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
unit-test:
name: unit testing
runs-on: ubuntu-latest

services:
postgres-integration:
image: postgres:16
env:
POSTGRES_USER: ${{ secrets.PGUSER }}
POSTGRES_PASSWORD: ${{ secrets.PGPASSWORD }}
POSTGRES_DB: ${{ secrets.PGDATABASE }}
ports:
- 5433:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres-test:
image: postgres:16
env:
POSTGRES_USER: ${{ secrets.PGUSER_TEST }}
POSTGRES_PASSWORD: ${{ secrets.PGPASSWORD_TEST }}
POSTGRES_DB: ${{ secrets.PGDATABASE_TEST }}
ports:
- 5434:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: create env
run: |
touch .env
PGHOST=${{ secrets.HOST }} >> .env
PGUSER=${{ secrets.PGUSER }} >> .env
PGDATABASE=${{ secrets.PGDATABASE }} >> .env
PGPASSWORD=${{ secrets.PGPASSWORD }} >> .env
PGPORT=${{ secrets.PGPORT }} >> .env
PGHOST_TEST=${{ secrets.PGHOST_TEST }} >> .env
PGUSER_TEST=${{ secrets.PGUSER_TEST }} >> .env
PGDATABASE_TEST=${{ secrets.PGDATABASE_TEST }} >> .env
PGPASSWORD_TEST=${{ secrets.PGPASSWORD_TEST }} >> .env
PGPORT_TEST=${{ secrets.PGPORT_TEST }} >> .env
ACCESS_TOKEN_KEY=${{ secrets.ACCESS_TOKEN_KEY }} >> .env
REFRESH_TOKEN_KEY=${{ secrets.REFRESH_TOKEN_KEY}} >> .env
ACCCESS_TOKEN_AGE=${{secrets.ACCCESS_TOKEN_AGE}} >> .env
- name: checkout code into the source code directory
uses: actions/checkout@v4
- name: set up Node.js 21
uses: actions/setup-node@v4
with:
node-version: "21"

- run: npm install

# - name: database migrate integration
# run: npm run migrate

# - name: database migrate test
# run: npm run migrate:test

# - name: test
# run: npm run test

0 comments on commit 2bb80ab

Please sign in to comment.