Skip to content

Ignore multirange test pre PG 14 #25

Ignore multirange test pre PG 14

Ignore multirange test pre PG 14 #25

Workflow file for this run

name: NativeAOT
on:
push:
branches:
- main
- 'hotfix/**'
tags:
- '*'
pull_request:
# Cancel previous PR branch commits (head_ref is only defined on PRs)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
dotnet_sdk_version: '8.0.203'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Uncomment and edit the following to use nightly/preview builds
# nuget_config: |
# <?xml version="1.0" encoding="utf-8"?>
# <configuration>
#
# <packageSources>
# <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
# <add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
# </packageSources>
#
# <packageSourceMapping>
# <packageSource key="nuget.org">
# <package pattern="*" />
# </packageSource>
# <packageSource key="dotnet8">
# <package pattern="runtime.*" />
# <package pattern="Microsoft.NETCore.App.Runtime.*" />
# <package pattern="Microsoft.AspNetCore.App.Runtime.*" />
# <package pattern="Microsoft.NET.ILLink.Tasks" />
# <package pattern="Microsoft.DotNet.ILCompiler" />
# </packageSource>
# </packageSourceMapping>
#
# </configuration>
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
pg_major: [15]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: NuGet Cache
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Build.targets') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: |
${{ env.dotnet_sdk_version }}
# - name: Setup nuget config
# run: echo "$nuget_config" > NuGet.config
- name: Setup Native AOT prerequisites
run: sudo apt-get install clang zlib1g-dev
shell: bash
- name: Build
run: dotnet publish test/Npgsql.NativeAotTests/Npgsql.NativeAotTests.csproj -r linux-x64 -c Release -f net8.0 -p:OptimizationPreference=Size
shell: bash
# Uncomment the following to SSH into the agent running the build (https://github.com/mxschmitt/action-tmate)
#- uses: actions/checkout@v4
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Start PostgreSQL
run: |
sudo systemctl start postgresql.service
sudo -u postgres psql -c "CREATE USER npgsql_tests SUPERUSER PASSWORD 'npgsql_tests'"
sudo -u postgres psql -c "CREATE DATABASE npgsql_tests OWNER npgsql_tests"
- name: Run
run: test/Npgsql.NativeAotTests/bin/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests
- name: Write binary size to summary
run: |
size="$(ls -l test/Npgsql.NativeAotTests/bin/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests | cut -d ' ' -f 5)"
echo "Binary size is $size bytes ($((size / (1024 * 1024))) mb)" >> $GITHUB_STEP_SUMMARY
- name: Dump mstat
run: dotnet run --project test/MStatDumper/MStatDumper.csproj -c release -f net8.0 -- "test/Npgsql.NativeAotTests/obj/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests.mstat" md >> $GITHUB_STEP_SUMMARY
- name: Upload mstat
uses: actions/upload-artifact@v4
with:
name: npgsql.mstat
path: "test/Npgsql.NativeAotTests/obj/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests.mstat"
retention-days: 3
- name: Upload codedgen dgml
uses: actions/upload-artifact@v4
with:
name: npgsql.codegen.dgml.xml
path: "test/Npgsql.NativeAotTests/obj/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests.codegen.dgml.xml"
retention-days: 3
- name: Upload scan dgml
uses: actions/upload-artifact@v4
with:
name: npgsql.scan.dgml.xml
path: "test/Npgsql.NativeAotTests/obj/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests.scan.dgml.xml"
retention-days: 3
- name: Assert binary size
run: |
size="$(ls -l test/Npgsql.NativeAotTests/bin/Release/net8.0/linux-x64/native/Npgsql.NativeAotTests | cut -d ' ' -f 5)"
echo "Binary size is $size bytes ($((size / (1024 * 1024))) mb)"
if (( size > 7340032 )); then
echo "Binary size exceeds 7mb threshold"
exit 1
fi