Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto

40 changes: 20 additions & 20 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: golangci-lint
on:
push:
branches:
- main
pull_request:
jobs:
golangci-pr:
name: lint-pr-changes
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
only-new-issues: true
name: golangci-lint
on:
push:
branches:
- main
pull_request:
jobs:
golangci-pr:
name: lint-pr-changes
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
only-new-issues: true
106 changes: 53 additions & 53 deletions .pipelines/TestSql2017.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
variables:
# AZURE_CLIENT_SECRET and SQLPASSWORD must be defined as secret variables in the pipeline.
# AZURE_TENANT_ID and AZURE_CLIENT_ID are not expected to be secret variables, just regular variables
AZURECLIENTSECRET: $(AZURE_CLIENT_SECRET)
PASSWORD: $(SQLPASSWORD)
pool:
vmImage: 'ubuntu-latest'
steps:
- template: include-install-go-tools.yml
- task: Docker@2
displayName: 'Run SQL 2017 docker image'
inputs:
command: run
arguments: '-m 2GB -e ACCEPT_EULA=1 -d --name sql2017 -p:1433:1433 -e SA_PASSWORD=$(PASSWORD) mcr.microsoft.com/mssql/server:2017-latest'
- template: include-runtests-linux.yml
parameters:
RunName: 'SQL2017'
SQLCMDUSER: sa
SQLPASSWORD: $(PASSWORD)
- template: include-runtests-linux.yml
parameters:
RunName: 'SQLDB'
# AZURESERVER must be defined as a variable in the pipeline
SQLCMDSERVER: $(AZURESERVER)
AZURECLIENTSECRET: $(AZURECLIENTSECRET)
- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4
displayName: Merge coverage data
inputs:
reports: '**/*.coverage.xml"' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
targetdir: 'coverage' # REQUIRED # The directory where the generated report should be saved.
reporttypes: 'HtmlInline_AzurePipelines;Cobertura' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary
sourcedirs: '$(Build.SourcesDirectory)' # Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information.
verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
tag: '$(build.buildnumber)_#$(build.buildid)_$(Build.SourceBranchName)' # Optional tag or build version.
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
pathToSources: '$(Build.SourcesDirectory)'
summaryFileLocation: $(Build.SourcesDirectory)/coverage/*.xml
reportDirectory: $(Build.SourcesDirectory)/coverage
failIfCoverageEmpty: true
condition: always()
continueOnError: true
env:
disable.coverage.autogenerate: 'true'
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: ‘Component Detection’
variables:
# AZURE_CLIENT_SECRET and SQLPASSWORD must be defined as secret variables in the pipeline.
# AZURE_TENANT_ID and AZURE_CLIENT_ID are not expected to be secret variables, just regular variables
AZURECLIENTSECRET: $(AZURE_CLIENT_SECRET)
PASSWORD: $(SQLPASSWORD)
pool:
vmImage: 'ubuntu-latest'

steps:
- template: include-install-go-tools.yml

- task: Docker@2
displayName: 'Run SQL 2017 docker image'
inputs:
command: run
arguments: '-m 2GB -e ACCEPT_EULA=1 -d --name sql2017 -p:1433:1433 -e SA_PASSWORD=$(PASSWORD) mcr.microsoft.com/mssql/server:2017-latest'

- template: include-runtests-linux.yml
parameters:
RunName: 'SQL2017'
SQLCMDUSER: sa
SQLPASSWORD: $(PASSWORD)

- template: include-runtests-linux.yml
parameters:
RunName: 'SQLDB'
# AZURESERVER must be defined as a variable in the pipeline
SQLCMDSERVER: $(AZURESERVER)
AZURECLIENTSECRET: $(AZURECLIENTSECRET)

- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4
displayName: Merge coverage data
inputs:
reports: '**/*.coverage.xml"' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
targetdir: 'coverage' # REQUIRED # The directory where the generated report should be saved.
reporttypes: 'HtmlInline_AzurePipelines;Cobertura' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary
sourcedirs: '$(Build.SourcesDirectory)' # Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information.
verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
tag: '$(build.buildnumber)_#$(build.buildid)_$(Build.SourceBranchName)' # Optional tag or build version.
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
pathToSources: '$(Build.SourcesDirectory)'
summaryFileLocation: $(Build.SourcesDirectory)/coverage/*.xml
reportDirectory: $(Build.SourcesDirectory)/coverage
failIfCoverageEmpty: true
condition: always()
continueOnError: true
env:
disable.coverage.autogenerate: 'true'

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: ‘Component Detection’
70 changes: 35 additions & 35 deletions .pipelines/include-install-go-tools.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
steps:
- task: GoTool@0
inputs:
version: '1.18'
- task: Go@0
displayName: 'Go: get dependencies'
inputs:
command: 'get'
arguments: '-d'
workingDirectory: '$(Build.SourcesDirectory)/cmd/sqlcmd'
- task: Go@0
displayName: 'Go: install gotest.tools/gotestsum'
inputs:
command: 'custom'
customCommand: 'install'
arguments: 'gotest.tools/gotestsum@latest'
workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: Go@0
displayName: 'Go: install github.com/axw/gocov/gocov'
inputs:
command: 'custom'
customCommand: 'install'
arguments: 'github.com/axw/gocov/gocov@latest'
workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: Go@0
displayName: 'Go: install github.com/axw/gocov/gocov'
inputs:
command: 'custom'
customCommand: 'install'
arguments: 'github.com/AlekSi/gocov-xml@latest'
workingDirectory: '$(System.DefaultWorkingDirectory)'
steps:
- task: GoTool@0
inputs:
version: '1.18'
- task: Go@0
displayName: 'Go: get dependencies'
inputs:
command: 'get'
arguments: '-d'
workingDirectory: '$(Build.SourcesDirectory)/cmd/sqlcmd'


- task: Go@0
displayName: 'Go: install gotest.tools/gotestsum'
inputs:
command: 'custom'
customCommand: 'install'
arguments: 'gotest.tools/gotestsum@latest'
workingDirectory: '$(System.DefaultWorkingDirectory)'

- task: Go@0
displayName: 'Go: install github.com/axw/gocov/gocov'
inputs:
command: 'custom'
customCommand: 'install'
arguments: 'github.com/axw/gocov/gocov@latest'
workingDirectory: '$(System.DefaultWorkingDirectory)'

- task: Go@0
displayName: 'Go: install github.com/axw/gocov/gocov'
inputs:
command: 'custom'
customCommand: 'install'
arguments: 'github.com/AlekSi/gocov-xml@latest'
workingDirectory: '$(System.DefaultWorkingDirectory)'

92 changes: 46 additions & 46 deletions .pipelines/include-runtests-linux.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
parameters:
- name: RunName
type: string
- name: SQLCMDUSER
type: string
default: ''
- name: SQLPASSWORD
type: string
default: ''
- name: AZURECLIENTSECRET
type: string
default: ''
- name: SQLCMDSERVER
type: string
default: .
- name: SQLCMDDBNAME
type: string
default: ''
steps:
- script: |
~/go/bin/gotestsum --junitfile "${{ parameters.RunName }}.testresults.xml" -- ./... -coverprofile="${{ parameters.RunName }}.coverage.txt" -covermode count
~/go/bin/gocov convert "${{ parameters.RunName }}.coverage.txt" > "${{ parameters.RunName }}.coverage.json"
~/go/bin/gocov-xml < "${{ parameters.RunName }}.coverage.json" > ${{ parameters.RunName }}.coverage.xml
mkdir -p coverage
workingDirectory: '$(Build.SourcesDirectory)'
displayName: 'run tests'
env:
SQLPASSWORD: ${{ parameters.SQLPASSWORD }}
SQLCMDUSER: ${{ parameters.SQLCMDUSER }}
SQLCMDPASSWORD: ${{ parameters.SQLPASSWORD }}
AZURE_TENANT_ID: $(AZURE_TENANT_ID)
AZURE_CLIENT_ID: $(AZURE_CLIENT_ID)
AZURE_CLIENT_SECRET: ${{ parameters.AZURECLIENTSECRET }}
SQLCMDSERVER: ${{ parameters.SQLCMDSERVER }}
SQLCMDDBNAME: ${{ parameters.SQLCMDDBNAME }}
continueOnError: true
- task: PublishTestResults@2
displayName: "Publish junit-style results"
inputs:
testResultsFiles: '${{ parameters.RunName }}.testresults.xml'
testResultsFormat: JUnit
searchFolder: '$(Build.SourcesDirectory)'
testRunTitle: '${{ parameters.RunName }} - $(Build.SourceBranchName)'
failTaskOnFailedTests: true
condition: always()
parameters:
- name: RunName
type: string
- name: SQLCMDUSER
type: string
default: ''
- name: SQLPASSWORD
type: string
default: ''
- name: AZURECLIENTSECRET
type: string
default: ''
- name: SQLCMDSERVER
type: string
default: .
- name: SQLCMDDBNAME
type: string
default: ''
steps:
- script: |
~/go/bin/gotestsum --junitfile "${{ parameters.RunName }}.testresults.xml" -- ./... -coverprofile="${{ parameters.RunName }}.coverage.txt" -covermode count
~/go/bin/gocov convert "${{ parameters.RunName }}.coverage.txt" > "${{ parameters.RunName }}.coverage.json"
~/go/bin/gocov-xml < "${{ parameters.RunName }}.coverage.json" > ${{ parameters.RunName }}.coverage.xml
mkdir -p coverage
workingDirectory: '$(Build.SourcesDirectory)'
displayName: 'run tests'
env:
SQLPASSWORD: ${{ parameters.SQLPASSWORD }}
SQLCMDUSER: ${{ parameters.SQLCMDUSER }}
SQLCMDPASSWORD: ${{ parameters.SQLPASSWORD }}
AZURE_TENANT_ID: $(AZURE_TENANT_ID)
AZURE_CLIENT_ID: $(AZURE_CLIENT_ID)
AZURE_CLIENT_SECRET: ${{ parameters.AZURECLIENTSECRET }}
SQLCMDSERVER: ${{ parameters.SQLCMDSERVER }}
SQLCMDDBNAME: ${{ parameters.SQLCMDDBNAME }}
continueOnError: true

- task: PublishTestResults@2
displayName: "Publish junit-style results"
inputs:
testResultsFiles: '${{ parameters.RunName }}.testresults.xml'
testResultsFormat: JUnit
searchFolder: '$(Build.SourcesDirectory)'
testRunTitle: '${{ parameters.RunName }} - $(Build.SourceBranchName)'
failTaskOnFailedTests: true
condition: always()
50 changes: 25 additions & 25 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# TODO: The maintainer of this repo has not yet edited this file
**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?
- **No CSS support:** Fill out this template with information about how to file issues and get help.
- **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport).
- **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide.
*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
# Support
## How to file issues and get help
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
issues before filing new issues to avoid duplicates. For new issues, file your bug or
feature request as a new Issue.
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
## Microsoft Support Policy
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
# TODO: The maintainer of this repo has not yet edited this file

**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?

- **No CSS support:** Fill out this template with information about how to file issues and get help.
- **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport).
- **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide.

*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*

# Support

## How to file issues and get help

This project uses GitHub Issues to track bugs and feature requests. Please search the existing
issues before filing new issues to avoid duplicates. For new issues, file your bug or
feature request as a new Issue.

For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.

## Microsoft Support Policy

Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
Loading