fix: ci action db env #81
Workflow file for this run
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 | |
on: | |
push: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
typecheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Typecheck | |
run: | | |
docker build --target=typecheck --no-cache . | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Lint check | |
run: | | |
docker build --target=lint --no-cache . | |
test: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: postgres:latest | |
ports: | |
- 5432:5432 | |
volumes: | |
- ./db-scripts:/docker-entrypoint-initdb.d/ | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
POSTGRES_DB: acm_website | |
options: >- | |
--health-cmd "pg_isready -U postgres" | |
--health-interval 5s | |
--health-timeout 5s | |
--health-retries 5 | |
--health-start-period 15s | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test | |
run: | | |
docker build --target=test --no-cache . | |
build: | |
needs: [typecheck, lint, test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
docker build --target=run --no-cache . |