Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1757860 Fips compliant GCM encryption #1058

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
120 changes: 99 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,81 @@ concurrency:
# SEQUENTIAL_ENV: SEQUENTIAL_TEST_RUN

jobs:
test-windows:
name: Tests on Windows
test-windows-core:
name: Tests on Windows for Core
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0', 'net7.0', 'net8.0', 'net462', 'net471', 'net472', 'net48', 'net481']
dotnet: ['net6.0', 'net7.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
target_framework: ['netstandard2.0', 'netstandard2.1']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Setup dotnet-coverage
run: dotnet tool install --global dotnet-coverage --version 17.8.4
- name: Decrypt Parameters
shell: bash
env:
PARAMETER_SECRET: ${{ secrets.PARAMETER_SECRET }}
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETER_SECRET" \
./.github/workflows/parameters/parameters_${{ matrix.cloud_env }}.json.gpg > Snowflake.Data.Tests/parameters.json
- name: Build Driver
run: |
cd Snowflake.Data.Tests
dotnet restore
dotnet build -f ${{ matrix.dotnet }} '-p:DefineAdditionalConstants=SF_PUBLIC_ENVIRONMENT'
env:
SF_TARGET_FRAMEWORK: ${{ matrix.target_framework }}
- name: Run Tests
run: |
cd Snowflake.Data.Tests
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml --output-format cobertura --settings coverage.config
env:
snowflake_cloud_env: ${{ matrix.cloud_env }}
net_version: ${{ matrix.dotnet }}
SF_TARGET_FRAMEWORK: ${{ matrix.target_framework }}
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v4
with:
name: code-coverage-report_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml

- name: Upload Test Performance Report
uses: actions/upload-artifact@v4
with:
name: tests-performance_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_performance.csv
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
fail_ci_if_error: true
files: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml

test-windows-framework:
name: Tests on Windows for Framework
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
dotnet: ['net462', 'net471', 'net472', 'net48', 'net481']
cloud_env: ['AZURE', 'GCP', 'AWS']
target_framework: ['netstandard2.0']
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -61,31 +128,34 @@ jobs:
cd Snowflake.Data.Tests
dotnet restore
dotnet build -f ${{ matrix.dotnet }} '-p:DefineAdditionalConstants=SF_PUBLIC_ENVIRONMENT'
env:
SF_TARGET_FRAMEWORK: ${{ matrix.target_framework }}
- name: Run Tests
run: |
cd Snowflake.Data.Tests
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml --output-format cobertura --settings coverage.config
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml --output-format cobertura --settings coverage.config
env:
snowflake_cloud_env: ${{ matrix.cloud_env }}
net_version: ${{ matrix.dotnet }}
SF_TARGET_FRAMEWORK: ${{ matrix.target_framework }}
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v4
with:
name: code-coverage-report_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
name: code-coverage-report_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml

- name: Upload Test Performance Report
uses: actions/upload-artifact@v4
with:
name: tests-performance_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
name: tests-performance_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_performance.csv
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
fail_ci_if_error: true
files: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
files: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml

test-linux:
name: Tests on Linux
Expand All @@ -95,6 +165,7 @@ jobs:
matrix:
dotnet: ['net6.0', 'net7.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
target_framework: ['netstandard2.0', 'netstandard2.1']
steps:
- uses: actions/checkout@v4
- name: Setup Dotnet
Expand All @@ -121,30 +192,33 @@ jobs:
run: |
dotnet restore
dotnet build '-p:DefineAdditionalConstants=SF_PUBLIC_ENVIRONMENT'
env:
SF_TARGET_FRAMEWORK: ${{ matrix.target_framework }}
- name: Run Tests
run: |
cd Snowflake.Data.Tests
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml --output-format cobertura --settings coverage.config
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml --output-format cobertura --settings coverage.config
env:
snowflake_cloud_env: ${{ matrix.cloud_env }}
net_version: ${{ matrix.dotnet }}
SF_TARGET_FRAMEWORK: ${{ matrix.target_framework }}
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v4
with:
name: code-coverage-report_linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
name: code-coverage-report_linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}
path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml
- name: Upload Test Performance Report
uses: actions/upload-artifact@v4
with:
name: tests-performance_linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
name: tests-performance_linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}
path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_performance.csv
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
fail_ci_if_error: true
files: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
files: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml

test-mac:
name: Tests on MAC
Expand All @@ -154,6 +228,7 @@ jobs:
matrix:
dotnet: ['net6.0', 'net7.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
target_framework: ['netstandard2.0', 'netstandard2.1']
steps:
- uses: actions/checkout@v4
- name: Setup Dotnet
Expand All @@ -180,27 +255,30 @@ jobs:
run: |
dotnet restore
dotnet build '-p:DefineAdditionalConstants=SF_PUBLIC_ENVIRONMENT'
env:
SF_TARGET_FRAMEWORK: ${{ matrix.target_framework }}
- name: Run Tests
run: |
cd Snowflake.Data.Tests
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml --output-format cobertura --settings coverage.config
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml --output-format cobertura --settings coverage.config
env:
snowflake_cloud_env: ${{ matrix.cloud_env }}
net_version: ${{ matrix.dotnet }}
SF_TARGET_FRAMEWORK: ${{ matrix.target_framework }}
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v4
with:
name: code-coverage-report_macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
name: code-coverage-report_macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}
path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml
- name: Upload Test Performance Report
uses: actions/upload-artifact@v4
with:
name: tests-performance_macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
name: tests-performance_macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}
path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_performance.csv
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
fail_ci_if_error: true
files: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
files: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.target_framework }}_coverage.xml
12 changes: 11 additions & 1 deletion Snowflake.Data.Tests/Snowflake.Data.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="Tomlyn.Signed" Version="0.17.0" />
<ProjectReference Include="..\Snowflake.Data\Snowflake.Data.csproj" />
</ItemGroup>

<ItemGroup Condition="$(SF_TARGET_FRAMEWORK) != ''">
<ProjectReference Include="..\Snowflake.Data\Snowflake.Data.csproj">
<SetTargetFramework>TargetFramework=$(SF_TARGET_FRAMEWORK)</SetTargetFramework>
</ProjectReference>
</ItemGroup>

<ItemGroup Condition="$(SF_TARGET_FRAMEWORK) == ''">
<ProjectReference Include="..\Snowflake.Data\Snowflake.Data.csproj"/>
</ItemGroup>

<Target Name="CopyCustomContent" AfterTargets="AfterBuild">
<Copy SourceFiles="parameters.json" DestinationFolder="$(OutDir)" />
<Copy SourceFiles="App.config" DestinationFolder="$(OutDir)" />
Expand Down
Loading
Loading