chore: make changed to build images #27
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
name: CI for transaction service | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- services/transaction/** | |
pull_request: | |
branches: | |
- main | |
paths: | |
- services/transaction/** | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: services/transaction | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up bun | |
uses: oven-sh/setup-bun@v2 | |
- name: Install dependencies | |
run: bun install | |
- name: Lint with TSC | |
run: bun tsc | |
- name: Lint with ESLint | |
run: bun eslint . | |
format: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: services/transaction | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up bun | |
uses: oven-sh/setup-bun@v2 | |
- name: Install dependencies | |
run: bun install | |
- name: Check format | |
run: bun prettier . --check | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: services/transaction | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up bun | |
uses: oven-sh/setup-bun@v2 | |
- name: Install dependencies | |
run: bun install | |
- name: Build | |
run: bun run build | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: services/transaction | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Start containers | |
run: docker compose -f docker-compose.test.yaml up -d --build | |
- name: Ping PostgreSQL container | |
run: docker exec nshm-transaction-test-api-1 ping -c 3 postgres | |
- name: Run unit tests | |
run: docker exec nshm-transaction-test-api-1 bun test unit.test.ts --coverage | |
- name: Run integration tests | |
run: docker exec nshm-transaction-test-api-1 bun test integration.test.ts --coverage |