Closed mrbiggred closed 1 week ago
Here are the code search results. I'm now analyzing these search results to write the PR.
.github/workflows/build-and-test.yml
Let's create the `.github/workflows` directory structure and add the `build-and-test.yml` file: 1. Open your terminal or command prompt and navigate to the root directory of your repository. 2. Run the following command to create the `.github` directory (if it doesn't already exist): ``` mkdir .github ``` 3. Navigate into the `.github` directory: ``` cd .github ``` 4. Create the `workflows` directory inside `.github`: ``` mkdir workflows ``` 5. Navigate into the `workflows` directory: ``` cd workflows ``` 6. Create a new file named `build-and-test.yml` inside the `.github/workflows` directory: ``` touch build-and-test.yml ``` (If you're using Windows, you can use `type nul > build-and-test.yml` instead) 7. Open the `build-and-test.yml` file in your preferred text editor and add the following content:
name: Build and Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: windows-latest
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: ${{ secrets.SA_PASSWORD }}
ports:
- 1433:1433
options: --name=sql1 --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
env:
ConnectionStrings__Master: Server=localhost;Database=Master;User Id=sa;Password=${{ secrets.SA_PASSWORD }};TrustServerCertificate=True;
run: dotnet test --no-build --verbosity normal
Source/MigratorTests/App.config
1.
---
+++
@@ -1,3 +1,3 @@
<connectionStrings>
- <add name="Master" connectionString="Server=localhost;Database=Master;Uid=sa;Pwd=password1234!;TrustServerCertificate=True;" />
+ <add name="Master" connectionString="Server=localhost;Database=Master;User Id=sa;Password=password1234!;TrustServerCertificate=True;" />
</connectionStrings>
Your changes have been successfully made to the branch sweep/create_github_action_to_compile_and_run
. I have validated these changes using a syntax checker and a linter.
[!TIP] To recreate the pull request, edit the issue title or description.
This is an automated message generated by Sweep AI.
The GitHub Action should compile Migrator and run all the unit tests. The tests require a SQL Server 2022 database. You can find the connection string in the
app.config.
in theMigratorTests
project.