Update swift.yml
#48
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
name: Local | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Debug Docker container creation | |
run: | | |
docker create --name test_postgres -p 5433:5433 \ | |
-e POSTGRES_USER=vapor \ | |
-e POSTGRES_PASSWORD=vapor \ | |
-e POSTGRES_DB=vapor-comments \ | |
postgres:14 | |
docker start test_postgres | |
docker logs test_postgres | |
- name: Check Docker permissions | |
run: docker ps | |
- 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: 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 |