|
3 | 3 | workflow_dispatch: |
4 | 4 |
|
5 | 5 | jobs: |
6 | | - generate-database: |
| 6 | + generate-compat-db: |
7 | 7 | runs-on: ubuntu-latest |
8 | | - |
9 | 8 | container: |
10 | 9 | image: ghcr.io/dojoengine/katana-dev:latest |
11 | | - |
12 | | - permissions: |
13 | | - contents: write |
14 | | - pull-requests: write |
15 | | - |
16 | 10 | steps: |
17 | 11 | - uses: actions/checkout@v4 |
18 | 12 | with: |
|
41 | 35 | - name: Generate test database |
42 | 36 | run: ./scripts/generate-test-db.sh --dojo-tag v1.6.0 |
43 | 37 |
|
| 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 | + |
44 | 96 | - id: version_info |
45 | 97 | run: | |
46 | 98 | DATE=$(date +%Y%m%d%H%M%S) |
|
52 | 104 | base: main |
53 | 105 | delete-branch: true |
54 | 106 | token: ${{ secrets.CREATE_PR_TOKEN }} |
55 | | - add-paths: tests/fixtures/katana_db.tar.gz |
| 107 | + add-paths: | |
| 108 | + tests/fixtures/db/ |
56 | 109 | 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