-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (35 loc) · 997 Bytes
/
test.yml
File metadata and controls
37 lines (35 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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