change postgres version #43
This file contains hidden or 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
# This workflow will build a Swift project | |
name: Local | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14 | |
env: | |
POSTGRES_USER: vapor | |
POSTGRES_PASSWORD: vapor | |
POSTGRES_DB: vapor-comments | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready -U vapor | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: SwiftyLab/setup-swift@latest | |
- name: Get swift version | |
run: swift --version | |
- name: Get swift version in macOS | |
if: runner.os == 'macOS' | |
run: xcrun --toolchain ${{ env.TOOLCHAINS }} swift --version | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Wait for PostgreSQL to be ready | |
run: | | |
until pg_isready -h localhost -U vapor; do | |
echo "Waiting for PostgreSQL to be ready..." | |
sleep 2 | |
done | |
- name: Build | |
run: sh build.sh | |
- name: Run tests | |
env: | |
DB_HOST: localhost | |
DB_USERNAME: vapor | |
DB_PASSWORD: vapor | |
DB_NAME: vapor-comments | |
run: swift test |