host 테스트의 레이스 컨디션 해결 시도 #222
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: Test core | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
container: node:18.16-bookworm | |
services: | |
postgres: | |
image: postgres:15.3-alpine | |
env: | |
POSTGRES_PASSWORD: foo | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Prepare database | |
env: | |
PGPASSFILE: /tmp/pgpass | |
run: | | |
apt update && apt install -y postgresql | |
echo 'postgres:5432:*:postgres:foo' > $PGPASSFILE | |
chmod 600 $PGPASSFILE | |
psql -h postgres -U postgres -w -c 'create database id;' | |
psql -h postgres -U postgres -w id < ./schema.sql | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .yarn/cache | |
key: ${{ runner.os }}-build.1-core-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build.1-core- | |
${{ runner.os }}-build.1- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: 'yarn install --immutable' | |
- name: Run tests | |
run: 'yarn test' |