Skip to content

Release v2.6.0

Release v2.6.0 #377

name: Validate SQL Scripts
on:
workflow_dispatch:
push:
branches: ["main", "development"]
paths:
- "src/Dfe.PlanTech.DatabaseUpgrader/**"
- ".github/scripts/**"
- ".github/workflows/validate-scripts.yml"
pull_request:
branches: ["main", "development"]
paths:
- "src/Dfe.PlanTech.DatabaseUpgrader/**"
- ".github/scripts/**"
- ".github/workflows/validate-scripts.yml"
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
validate-sql-scripts:
name: Validate SQL Scripts
runs-on: ubuntu-22.04
env:
FAKE_USERNAME: "sa" # NB. This is OK to be plaintext as it's a made-up credential to give the locally hosted DB a "user"
FAKE_PASSWORD: "LWgqx62jIO2sRek8" # NB. See Above
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build Database Upgrader
uses: ./.github/actions/build-dotnet-app
with:
dotnet_version: ${{ vars.DOTNET_VERSION }}
solution_filename: Dfe.PlanTech.DatabaseUpgrader.sln
- name: Get DB Connection String
id: connection-string
run: |
CONNECTION_STRING="Server=tcp:localhost,1433;Initial Catalog=master;Persist Security Info=False;User ID=${{ env.FAKE_USERNAME }};Password=${{ env.FAKE_PASSWORD }};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;"
echo "CONNECTION_STRING=$CONNECTION_STRING" >> $GITHUB_OUTPUT
- name: Pull Azure SQL Edge Docker Image
shell: bash
run: docker pull mcr.microsoft.com/azure-sql-edge:latest
- name: Start Azure SQL Edge Instance
shell: bash
run: docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=${{ env.FAKE_PASSWORD }}' -p 1433:1433 --name azuresqledge -d mcr.microsoft.com/azure-sql-edge
- name: Wait for Docker Image to Startup
shell: bash
run: sleep 16s
- name: Run Database Upgrader
shell: bash
run: dotnet ./build/Dfe.PlanTech.DatabaseUpgrader.dll -c "${{ steps.connection-string.outputs.CONNECTION_STRING }}"
quality-check:
name: Run SQL Code Quality Check
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run SQLCheck
uses: yokawasa/action-sqlcheck@v1.5.0
with:
post-comment: true
token: ${{ secrets.GITHUB_TOKEN }}
postfixes: |
sql