mirror of
https://github.com/DapperLib/Dapper.git
synced 2026-10-18 14:27:47 +08:00
58 lines
2.0 KiB
YAML
58 lines
2.0 KiB
YAML
name: Main Build
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- '*'
|
|
- '!/docs/*' # Don't run workflow when files are only in the /docs directory
|
|
|
|
jobs:
|
|
vm-job:
|
|
name: Ubuntu
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: postgres
|
|
ports:
|
|
- 5432/tcp
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: test
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
sqlserver:
|
|
image: mcr.microsoft.com/mssql/server:2019-latest
|
|
ports:
|
|
- 1433/tcp
|
|
env:
|
|
ACCEPT_EULA: Y
|
|
SA_PASSWORD: "Password."
|
|
mysql:
|
|
image: mysql
|
|
ports:
|
|
- 3306/tcp
|
|
env:
|
|
MYSQL_ROOT_PASSWORD: root
|
|
MYSQL_DATABASE: test
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v1
|
|
- name: Setup dotnet
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '10.0.x'
|
|
- name: .NET Build
|
|
run: dotnet build Build.csproj -c Release /p:CI=true
|
|
- name: Dapper Tests
|
|
run: dotnet test tests/Dapper.Tests/Dapper.Tests.csproj -c Release --logger GitHubActions -p:CI=true -p:TestTfmsInParallel=false
|
|
env:
|
|
MySqlConnectionString: Server=localhost;Port=${{ job.services.mysql.ports[3306] }};Uid=root;Pwd=root;Database=test;Allow User Variables=true
|
|
OLEDBConnectionString: Provider=SQLOLEDB;Server=tcp:localhost,${{ job.services.sqlserver.ports[1433] }};Database=tempdb;User Id=sa;Password=Password.;
|
|
PostgesConnectionString: Server=localhost;Port=${{ job.services.postgres.ports[5432] }};Database=test;User Id=postgres;Password=postgres;
|
|
SqlServerConnectionString: Server=tcp:localhost,${{ job.services.sqlserver.ports[1433] }};Database=tempdb;User Id=sa;Password=Password.;
|
|
- name: .NET Lib Pack
|
|
run: dotnet pack Build.csproj --no-build -c Release /p:PackageOutputPath=%CD%\.nupkgs /p:CI=true
|