Skip to content

Commit

Permalink
Added database migration step before dotnet test
Browse files Browse the repository at this point in the history
  • Loading branch information
DrizzlyOwl committed Mar 16, 2023
1 parent 387a203 commit 79dafd2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/continuous-integration-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
DOTNET_VERSION: '3.1.301'
EF_VERSION: '6.0.5'
JAVA_VERSION: '11'
CONNECTION_STRING: 'Server=localhost,1433;Database=sip;User Id=sa;TrustServerCertificate=True;Password=Your_password123'

jobs:
build-and-test:
Expand Down Expand Up @@ -61,6 +62,12 @@ jobs:
- name: Restore dependencies
run: dotnet restore

- name: Run TramsDbContext database migrations
run: dotnet ef database update --connection ${{ env.CONNECTION_STRING }} --project TramsDataApi --context TramsDataApi.DatabaseModels.TramsDbContext

- name: Run LegacyTramsDbContext database migrations
run: dotnet ef database update --connection ${{ env.CONNECTION_STRING }} --project TramsDataApi --context TramsDataApi.DatabaseModels.LegacyTramsDbContext

- name: Build, Test and Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 79dafd2

Please sign in to comment.