[deps]: Lock file maintenance #1948
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: migrations | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
env: | |
# Setting these variables allows .NET CLI to use rich color codes in console output | |
TERM: xterm | |
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true | |
# Skip boilerplate output | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_NOLOGO: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
jobs: | |
script: | |
strategy: | |
matrix: | |
app: | |
- Api | |
- AdminConsole | |
include: | |
- app: Api | |
ef-context: DbGlobalMsSqlContext | |
- app: AdminConsole | |
ef-context: MssqlConsoleDbContext | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Install .NET | |
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 | |
- name: Install Entity Framework toolkit | |
run: dotnet tool install dotnet-ef --global | |
- name: Generate script | |
run: > | |
dotnet ef migrations script | |
--configuration Release | |
--project src/${{ matrix.app }} | |
--context ${{ matrix.ef-context }} | |
--idempotent | |
--output ${{ matrix.app }}.sql | |
- name: Upload artifacts | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
with: | |
name: ${{ matrix.app }}-${{ matrix.ef-context }} | |
path: ${{ matrix.app }}.sql | |
- name: Produce summary | |
run: | | |
echo "### Idempotent migrations for ${{ matrix.app }} (${{ matrix.ef-context }})" >> $GITHUB_STEP_SUMMARY | |
echo "\`\`\`sql" >> $GITHUB_STEP_SUMMARY | |
cat ${{ matrix.app }}.sql >> $GITHUB_STEP_SUMMARY | |
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY |