Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,79 @@ jobs:
cd my-app
cargo test --all

rollback-generated-full:
name: "Test rollback on generated full example app"
runs-on: ubuntu-latest
needs: generate-full

services:
postgres:
image: postgres
env:
POSTGRES_DB: my_app
POSTGRES_USER: my_app
POSTGRES_PASSWORD: my_app
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
postgres_test:
image: postgres
env:
POSTGRES_DB: my_app_test
POSTGRES_USER: my_app_test
POSTGRES_PASSWORD: my_app_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5433:5432

steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1

- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: my-app-full
path: my-app

- name: migrate
run: |
cd my-app
cargo db reset
cargo db reset -e test

- name: test rollback without args (last 1)
run: |
cd my-app
cargo db rollback
cargo db rollback -e test
! cargo test --all
- name: test rollback (last 2)
run: |
cd my-app
cargo db migrate
cargo db migrate -e test
cargo test --all
cargo db rollback --steps 2
cargo db rollback --steps 2 -e test
! cargo test --all
- name: test rollback to tasks
run: |
cd my-app
cargo db migrate
cargo db migrate -e test
cargo test --all
cargo db rollback --to create_tasks_table
cargo db rollback --to create_tasks_table -e test
! cargo test --all

fmt-generated-full:
name: "Validate format of generated full example app"
runs-on: ubuntu-latest
Expand Down Expand Up @@ -468,6 +541,7 @@ jobs:
run: |
cd my-app
cargo generate migration CreatePeopleTable
cargo generate migration AddIndexToPeople --simple

- name: generate-entity
run: |
Expand Down
Loading
Loading