From 91681d03303303f836fd01c8e64bc2f53cb5bdb8 Mon Sep 17 00:00:00 2001 From: Miguel Martinez Trivino Date: Thu, 20 Jul 2023 16:14:35 +0200 Subject: [PATCH] chore(ci): check generated controlplane migrations Signed-off-by: Miguel Martinez Trivino --- .github/workflows/test.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4ca839e0..f327d3529 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,6 +38,17 @@ jobs: go mod tidy git diff --exit-code -- go.mod go.sum + # Generate any possible migration from a schema change that way + # we can detect any migration file that has not been checked in to git + # This could happen if the developer ran make generate but didn't run make migration_new + - name: Generate migrations + if: ${{ matrix.app == 'controlplane' }} + run: | + wget -q https://release.ariga.io/atlas/atlas-linux-amd64-latest -O /tmp/atlas + sudo install /tmp/atlas /usr/local/bin/atlas + + make -C app/controlplane migration_new + # Check that the generated ent code is up to date # see https://entgo.io/docs/ci/ - uses: ent/contrib/ci@master