|
| 1 | +name: Main Build |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + paths: |
| 9 | + - '*' |
| 10 | + - '!/docs/*' # Don't run workflow when files are only in the /docs directory |
| 11 | + |
| 12 | +jobs: |
| 13 | + vm-job: |
| 14 | + name: Ubuntu |
| 15 | + runs-on: ubuntu-latest |
| 16 | + services: |
| 17 | + postgres: |
| 18 | + image: postgres |
| 19 | + ports: |
| 20 | + - 5432/tcp |
| 21 | + env: |
| 22 | + POSTGRES_USER: postgres |
| 23 | + POSTGRES_PASSWORD: postgres |
| 24 | + POSTGRES_DB: test |
| 25 | + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 |
| 26 | + sqlserver: |
| 27 | + image: mcr.microsoft.com/mssql/server:2019-latest |
| 28 | + ports: |
| 29 | + - 1433/tcp |
| 30 | + env: |
| 31 | + ACCEPT_EULA: Y |
| 32 | + SA_PASSWORD: "Password." |
| 33 | + mysql: |
| 34 | + image: mysql |
| 35 | + ports: |
| 36 | + - 3306/tcp |
| 37 | + env: |
| 38 | + MYSQL_ROOT_PASSWORD: root |
| 39 | + MYSQL_DATABASE: test |
| 40 | + steps: |
| 41 | + - name: Checkout code |
| 42 | + uses: actions/checkout@v1 |
| 43 | + - name: .NET Build |
| 44 | + run: dotnet build Build.csproj -c Release /p:CI=true |
| 45 | + - name: Dapper Tests |
| 46 | + run: dotnet test tests/Dapper.Tests/Dapper.Tests.csproj -c Release --logger GitHubActions /p:CI=true |
| 47 | + env: |
| 48 | + MySqlConnectionString: Server=localhost;Port=${{ job.services.mysql.ports[3306] }};Uid=root;Pwd=root;Database=test;Allow User Variables=true |
| 49 | + OLEDBConnectionString: Provider=SQLOLEDB;Server=tcp:localhost,${{ job.services.sqlserver.ports[1433] }};Database=tempdb;User Id=sa;Password=Password.; |
| 50 | + PostgesConnectionString: Server=localhost;Port=${{ job.services.postgres.ports[5432] }};Database=test;User Id=postgres;Password=postgres; |
| 51 | + SqlServerConnectionString: Server=tcp:localhost,${{ job.services.sqlserver.ports[1433] }};Database=tempdb;User Id=sa;Password=Password.; |
| 52 | + - name: Dapper.Contrib Tests |
| 53 | + run: dotnet test tests/Dapper.Tests.Contrib/Dapper.Tests.Contrib.csproj -c Release --logger GitHubActions /p:CI=true |
| 54 | + env: |
| 55 | + MySqlConnectionString: Server=localhost;Port=${{ job.services.mysql.ports[3306] }};Uid=root;Pwd=root;Database=test;Allow User Variables=true |
| 56 | + OLEDBConnectionString: Provider=SQLOLEDB;Server=tcp:localhost,${{ job.services.sqlserver.ports[1433] }};Database=tempdb;User Id=sa;Password=Password.; |
| 57 | + PostgesConnectionString: Server=localhost;Port=${{ job.services.postgres.ports[5432] }};Database=test;User Id=postgres;Password=postgres; |
| 58 | + SqlServerConnectionString: Server=tcp:localhost,${{ job.services.sqlserver.ports[1433] }};Database=tempdb;User Id=sa;Password=Password.; |
| 59 | + - name: .NET Lib Pack |
| 60 | + run: dotnet pack Build.csproj --no-build -c Release /p:PackageOutputPath=%CD%\.nupkgs /p:CI=true |
0 commit comments