Skip to content

Commit 2918b0f

Browse files
kariyclaude
andcommitted
ci: add migration db generation to test db workflow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3299de4 commit 2918b0f

File tree

1 file changed

+63
-10
lines changed

1 file changed

+63
-10
lines changed

.github/workflows/generate-db-dispatch.yml

Lines changed: 63 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@ on:
33
workflow_dispatch:
44

55
jobs:
6-
generate-database:
6+
generate-compat-db:
77
runs-on: ubuntu-latest
8-
98
container:
109
image: ghcr.io/dojoengine/katana-dev:latest
11-
12-
permissions:
13-
contents: write
14-
pull-requests: write
15-
1610
steps:
1711
- uses: actions/checkout@v4
1812
with:
@@ -41,6 +35,64 @@ jobs:
4135
- name: Generate test database
4236
run: ./scripts/generate-test-db.sh --dojo-tag v1.6.0
4337

38+
- name: Upload compat database artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: compat-db
42+
path: tests/fixtures/db/*.tar.gz
43+
44+
generate-migration-dbs:
45+
runs-on: ubuntu-latest
46+
container:
47+
image: ghcr.io/dojoengine/katana-dev:latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
# Workaround for https://github.com/actions/runner-images/issues/6775
52+
- run: git config --global --add safe.directory "*"
53+
- uses: Swatinem/rust-cache@v2
54+
55+
- name: Set sozo version
56+
run: asdf set sozo 1.7.0
57+
58+
- name: Build generate_migration_db
59+
run: cargo build --bin generate_migration_db --features node --release
60+
61+
- name: Generate spawn-and-move database
62+
run: ./target/release/generate_migration_db --example spawn-and-move --output tests/fixtures/db/spawn_and_move.tar.gz
63+
64+
- name: Generate simple database
65+
run: ./target/release/generate_migration_db --example simple --output tests/fixtures/db/simple.tar.gz
66+
67+
- name: Upload migration database artifacts
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: migration-dbs
71+
path: |
72+
tests/fixtures/db/spawn_and_move.tar.gz
73+
tests/fixtures/db/simple.tar.gz
74+
75+
create-pr:
76+
needs: [generate-compat-db, generate-migration-dbs]
77+
runs-on: ubuntu-latest
78+
permissions:
79+
contents: write
80+
pull-requests: write
81+
steps:
82+
- uses: actions/checkout@v4
83+
84+
- name: Download compat database
85+
uses: actions/download-artifact@v4
86+
with:
87+
name: compat-db
88+
path: tests/fixtures/db/
89+
90+
- name: Download migration databases
91+
uses: actions/download-artifact@v4
92+
with:
93+
name: migration-dbs
94+
path: tests/fixtures/db/
95+
4496
- id: version_info
4597
run: |
4698
DATE=$(date +%Y%m%d%H%M%S)
@@ -52,7 +104,8 @@ jobs:
52104
base: main
53105
delete-branch: true
54106
token: ${{ secrets.CREATE_PR_TOKEN }}
55-
add-paths: tests/fixtures/katana_db.tar.gz
107+
add-paths: |
108+
tests/fixtures/db/
56109
branch: db-update-${{ steps.version_info.outputs.version }}
57-
title: "chore(test): update test database for katana ${{ inputs.katana_version }}"
58-
commit-message: "Update test database for katana ${{ inputs.katana_version }}"
110+
title: "chore(test): update test database fixtures"
111+
commit-message: "chore(test): update test database fixtures"

0 commit comments

Comments
 (0)