V2024.09.17 #16
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 | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: Test Dbmate action | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_PASSWORD: postgres_password | |
ports: | |
- 5432:5432 | |
env: | |
DATABASE_URL: postgres://postgres:postgres_password@postgres:5432/postgres?sslmode=disable # used for all steps | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Dbmate Apply Migrations | |
uses: ./ # Uses an action in the root directory | |
with: | |
command: 'up' | |
env: # Optional environment variables | |
DBMATE_MIGRATIONS_DIR: "./migrations" | |
DBMATE_SCHEMA_FILE: "./db/test_db_schema.sql" | |
DBMATE_WAIT: "true" | |
DBMATE_WAIT_TIMEOUT: "30s" | |
- name: Add & Commit latest schema | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions |