|
1 | | -name: .NET Core |
2 | | - |
3 | | -on: |
4 | | - push |
5 | | - |
6 | | -env: |
7 | | - MSSQL_SA_PASSWORD: "YourStrong!Passw0rd" |
8 | | - ACCEPT_EULA: "Y" |
9 | | - MSSQL_PID: "developer" |
10 | | - |
11 | | -jobs: |
12 | | - build: |
13 | | - |
14 | | - runs-on: ubuntu-20.04 |
15 | | - services: |
16 | | - postgres: |
17 | | - image: postgres:latest |
18 | | - env: |
19 | | - POSTGRES_PASSWORD: pgpass4291 |
20 | | - options: >- |
21 | | - --health-cmd pg_isready |
22 | | - --health-interval 10s |
23 | | - --health-timeout 5s |
24 | | - --health-retries 5 |
25 | | - ports: |
26 | | - - 5432:5432 |
27 | | - |
28 | | - steps: |
29 | | - - name: Disable write flush for CI runs |
30 | | - run: sudo apt-get install -y libeatmydata1 apt-transport-https curl |
31 | | - - uses: actions/checkout@v3 |
32 | | - - name: Setup .NET Core |
33 | | - uses: actions/setup-dotnet@v2 |
34 | | - with: |
35 | | - dotnet-version: 6.0.x |
36 | | - - name: Install Sql Server |
37 | | - run: | |
38 | | - wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - |
39 | | - sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)" |
40 | | - sudo apt-get install -y --no-install-recommends postgresql mssql-tools mssql-server |
41 | | - sudo -E /opt/mssql/bin/mssql-conf -n setup accept-eula |
42 | | - - name: MySQL |
43 | | - run: | |
44 | | - sed -i'' -e 's|</TestDatabases>|<TestDatabase><DatabaseType>PostgreSql</DatabaseType><ConnectionString>User ID=postgres;Password=pgpass4291;Host=127.0.0.1;Port=5432</ConnectionString></TestDatabase></TestDatabases>|' Tests/FAnsiTests/TestDatabases.xml |
45 | | - sed -i'' -e 's/Pwd=;SslMode=None/Pwd=root;AllowPublicKeyRetrieval=true/' Tests/FAnsiTests/TestDatabases.xml |
46 | | - sudo systemctl start mysql.service |
47 | | - - name: Test |
48 | | - run: dotnet test --logger "console;verbosity=minimal" --nologo |
49 | | - - name: Pack |
50 | | - run: | |
51 | | - mkdir -p NuGet/bin |
52 | | - ln -sf Release/netstandard2.1 NuGet/bin/ |
53 | | - dotnet pack NuGet/FAnsi.NuGet.csproj -c Release --include-source --include-symbols --nologo -p:NuspecFile=`pwd`/NuGet/FAnsi.NuGet.nuspec -p:NuspecProperties=Version=$(fgrep AssemblyInformationalVersion SharedAssemblyInfo.cs|cut -d'"' -f2) -p:SymbolPackageFormat=snupkg |
54 | | - - name: Nuget push |
55 | | - if: contains(github.ref,'refs/tags/') |
56 | | - run: dotnet nuget push NuGet/bin/Release/HIC.FAnsiSql.*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_KEY }} --skip-duplicate |
57 | | - - name: Store created nupkg files |
58 | | - uses: actions/upload-artifact@v3 |
59 | | - with: |
60 | | - path: NuGet/bin/Release/*.nupkg |
61 | | - retention-days: 1 |
62 | | - - name: Upload release binaries |
63 | | - if: contains(github.ref,'refs/tags/') |
64 | | - uses: svenstaro/upload-release-action@v2 |
65 | | - with: |
66 | | - repo_token: ${{ secrets.GITHUB_TOKEN }} |
67 | | - tag: ${{ github.ref }} |
68 | | - file: NuGet/bin/Release/*.nupkg |
69 | | - file_glob: true |
70 | | - overwrite: true |
| 1 | +name: .NET Core |
| 2 | + |
| 3 | +on: |
| 4 | + push |
| 5 | + |
| 6 | +env: |
| 7 | + MSSQL_SA_PASSWORD: "YourStrong!Passw0rd" |
| 8 | + ACCEPT_EULA: "Y" |
| 9 | + MSSQL_PID: "developer" |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + |
| 14 | + runs-on: ubuntu-20.04 |
| 15 | + services: |
| 16 | + postgres: |
| 17 | + image: postgres:latest |
| 18 | + env: |
| 19 | + POSTGRES_PASSWORD: pgpass4291 |
| 20 | + options: >- |
| 21 | + --health-cmd pg_isready |
| 22 | + --health-interval 10s |
| 23 | + --health-timeout 5s |
| 24 | + --health-retries 5 |
| 25 | + ports: |
| 26 | + - 5432:5432 |
| 27 | + |
| 28 | + steps: |
| 29 | + - name: Disable write flush for CI runs |
| 30 | + run: sudo apt-get install -y libeatmydata1 apt-transport-https curl |
| 31 | + - uses: actions/checkout@v3 |
| 32 | + - name: Setup .NET Core |
| 33 | + uses: actions/setup-dotnet@v3 |
| 34 | + with: |
| 35 | + dotnet-version: 6.0.x |
| 36 | + - name: Install Sql Server |
| 37 | + run: | |
| 38 | + wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - |
| 39 | + sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)" |
| 40 | + sudo apt-get install -y --no-install-recommends postgresql mssql-tools mssql-server |
| 41 | + sudo -E /opt/mssql/bin/mssql-conf -n setup accept-eula |
| 42 | + - name: MySQL |
| 43 | + run: | |
| 44 | + sed -i'' -e 's|</TestDatabases>|<TestDatabase><DatabaseType>PostgreSql</DatabaseType><ConnectionString>User ID=postgres;Password=pgpass4291;Host=127.0.0.1;Port=5432</ConnectionString></TestDatabase></TestDatabases>|' Tests/FAnsiTests/TestDatabases.xml |
| 45 | + sed -i'' -e 's/Pwd=;SslMode=None/Pwd=root;AllowPublicKeyRetrieval=true/' Tests/FAnsiTests/TestDatabases.xml |
| 46 | + sudo systemctl start mysql.service |
| 47 | + - name: Test |
| 48 | + run: dotnet test --logger "console;verbosity=minimal" --nologo |
| 49 | + - name: Pack |
| 50 | + run: | |
| 51 | + mkdir -p NuGet/bin |
| 52 | + ln -sf Release/netstandard2.1 NuGet/bin/ |
| 53 | + dotnet pack NuGet/FAnsi.NuGet.csproj -c Release --include-source --include-symbols --nologo -p:NuspecFile=`pwd`/NuGet/FAnsi.NuGet.nuspec -p:NuspecProperties=Version=$(fgrep AssemblyInformationalVersion SharedAssemblyInfo.cs|cut -d'"' -f2) -p:SymbolPackageFormat=snupkg |
| 54 | + - name: Nuget push |
| 55 | + if: contains(github.ref,'refs/tags/') |
| 56 | + run: dotnet nuget push NuGet/bin/Release/HIC.FAnsiSql.*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_KEY }} --skip-duplicate |
| 57 | + - name: Store created nupkg files |
| 58 | + uses: actions/upload-artifact@v3 |
| 59 | + with: |
| 60 | + path: NuGet/bin/Release/*.nupkg |
| 61 | + retention-days: 1 |
| 62 | + - name: Upload release binaries |
| 63 | + if: contains(github.ref,'refs/tags/') |
| 64 | + uses: svenstaro/upload-release-action@v2 |
| 65 | + with: |
| 66 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + tag: ${{ github.ref }} |
| 68 | + file: NuGet/bin/Release/*.nupkg |
| 69 | + file_glob: true |
| 70 | + overwrite: true |
0 commit comments