Skip to content

Commit ff4a47f

Browse files
ci: build Designer before EF migrations checks (#18897)
1 parent 1d06cc9 commit ff4a47f

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/designer-backend-dotnet-migrations-ensure-compatibility.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@ jobs:
3434
- name: Install dotnet ef # Version should be the same as Migrations docker file and project
3535
run: dotnet tool install --version 9.0.0 --global dotnet-ef
3636

37+
- name: Build Designer backend
38+
run: |
39+
dotnet restore backend/src/Designer/Designer.csproj
40+
dotnet build backend/src/Designer/Designer.csproj --no-restore
41+
working-directory: src/Designer
42+
3743
- name: Check if migrations script can be generated
3844
run: |
39-
dotnet ef migrations script --project backend/src/Designer
45+
dotnet ef migrations script --project backend/src/Designer --no-build
4046
working-directory: src/Designer
4147

4248
- name: Check if it's possible to add a new migration
4349
run: |
44-
dotnet ef migrations add Test --project backend/src/Designer
50+
dotnet ef migrations add Test --project backend/src/Designer --no-build
4551
working-directory: src/Designer

src/Designer/backend/Migrations.Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ ENV OidcLoginSettings__ClientSecret=dummyRequired
1313
ENV FeatureManagement__StudioOidc=false
1414
ENV StudioOidcLoginSettings__FetchClientIdAndSecretFromRootEnvFile=false
1515

16-
RUN dotnet ef migrations script --project src/Designer/Designer.csproj --idempotent -o /app/migrations.sql
16+
RUN dotnet restore src/Designer/Designer.csproj && \
17+
dotnet build src/Designer/Designer.csproj --no-restore && \
18+
dotnet ef migrations script --project src/Designer/Designer.csproj --no-build --idempotent -o /app/migrations.sql
1719

1820
FROM alpine:3.23.3@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659 AS final
1921
COPY --from=build /app/migrations.sql migrations.sql

0 commit comments

Comments
 (0)