You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.6 KiB

name: PostgreSQL service example
on: push
jobs:
# Label of the container job
build:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: node:12-buster
env:
# The hostname used to communicate with the PostgreSQL service container
CODEGEN_DB_HOST: postgres
# The default PostgreSQL port
CODEGEN_DB_PORT: 5435
CODEGEN_DB_USER: codegenuser
CODEGEN_DB_PASSWOD: postgres
CODEGEN_DB_NAME: codegendb
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: codegenuser
POSTGRES_DB: codegendb
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5435:5432
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Coursier cache
uses: coursier/cache-action@v6
- name: Setup
uses: olafurpg/setup-scala@v10
with:
java-version: adopt@1.11
- name: Migrate
run: csbt flyway/flywayMigrate
- name: Run Tests
run: csbt test
- name: Package
run: csbt docker:stage