Skip to content
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
29 changes: 23 additions & 6 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,35 @@ permissions:

jobs:
build:
runs-on: windows-latest
name: build (${{ matrix.runner }}, ${{ matrix.framework }})
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
framework: net8.0
- runner: ubuntu-latest
framework: net10.0
- runner: windows-latest
framework: net8.0
- runner: windows-latest
framework: net10.0
- runner: windows-latest
framework: net48
runs-on: ${{ matrix.runner }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8
10
- name: Install .NET Framework (add MSBuild to Path)
uses: microsoft/setup-msbuild@v2
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: x64
- name: Restore dependencies
Expand All @@ -33,9 +50,9 @@ jobs:
- name: Test
# Strong name requires disabling xUnit app domains in order to get coverage using coverlet
# https://github.com/MarcoRossignoli/coverlet/blob/master/Documentation/KnownIssues.md#tests-fail-if-assembly-is-strong-named
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" test/Amazon.SecretsManager.Extensions.Caching.UnitTests -- RunConfiguration.DisableAppDomain=true
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" test/Amazon.SecretsManager.Extensions.Caching.UnitTests --framework ${{ matrix.framework }} -- RunConfiguration.DisableAppDomain=true
- name: Codecov
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v6
with:
directory: test/Amazon.SecretsManager.Extensions.Caching.UnitTests/TestResults
fail_ci_if_error: true
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/integ.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Integration Tests

on:
workflow_dispatch:
push:
branches: ["master"]
pull_request_target:
types: [labeled]

permissions:
id-token: write
contents: read

jobs:
integ:
if: |
github.event_name != 'pull_request_target' ||
contains(github.event.pull_request.labels.*.name, 'safe-to-test')
runs-on: windows-latest
steps:
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install .NET Framework (add MSBuild to Path)
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: ${{ runner.arch }}
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.ROLE_ARN }}
role-session-name: dotnet-caching-${{ github.run_id }}
aws-region: us-west-2
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal test/Amazon.SecretsManager.Extensions.Caching.IntegTests
31 changes: 31 additions & 0 deletions .github/workflows/pr-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Remove safe-to-test label when new commits are pushed

on:
pull_request_target:
types: [synchronize]

jobs:
remove-label:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
contents: read
if: |
contains(github.event.pull_request.labels.*.name, 'safe-to-test')

steps:
- name: Remove label
run: |
echo "Removing label '$LABEL_NAME' from PR #$PR_NUMBER on repo $REPO"
gh_status=$(gh api "repos/$REPO/issues/$PR_NUMBER/labels/$LABEL_NAME" -X DELETE | jq 'if type == "object" then .status else empty end' --raw-output)
case $gh_status in
"") echo "Label removed" ;;
404) echo "Label not found — ignoring" ;;
*) echo "unexpected HTTP $gh_status" && exit 1 ;;
esac
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LABEL_NAME: safe-to-test
REPO: ${{ github.event.pull_request.base.repo.full_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net48</TargetFrameworks>
<TargetFrameworks>net8.0;net10.0;net48</TargetFrameworks>
<IsPackable>false</IsPackable>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<SignAssembly>true</SignAssembly>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net48</TargetFrameworks>
<TargetFrameworks>net8.0;net10.0;net48</TargetFrameworks>
<IsPackable>false</IsPackable>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<SignAssembly>true</SignAssembly>
Expand Down
Loading