Trying out gha to run tests #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Integration Tests | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- project: tests/Aspire.Hosting.Elasticsearch.Tests/Aspire.Hosting.Elasticsearch.Tests.csproj | |
name: Elasticsearch | |
filter: "WithDataShouldPersistStateBetweenUsages" | |
- project: tests/Aspire.Hosting.PostgreSQL.Tests/Aspire.Hosting.PostgreSQL.Tests.csproj | |
name: PostgreSQL | |
filter: "" | |
- project: tests/Aspire.Hosting.Oracle.Tests/Aspire.Hosting.Oracle.Tests.csproj | |
name: Oracle | |
filter: "" | |
- project: tests/Aspire.Hosting.Kafka.Tests/Aspire.Hosting.Kafka.Tests.csproj | |
name: Kafka | |
filter: "" | |
- project: tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj | |
name: Hosting | |
filter: "ProxylessAndProxiedEndpointBothWorkOnSameResource" | |
- project: tests/Aspire.Hosting.Redis.Tests/Aspire.Hosting.Redis.Tests.csproj | |
name: Redis | |
filter: "RedisInsightWithDataShouldPersistStateBetweenUsages" | |
# Add more projects as needed | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: | | |
8.x | |
9.x | |
- name: Trust HTTPS development certificate | |
run: dotnet dev-certs https --trust | |
- name: Verify Docker is running | |
run: | | |
docker info | |
- name: Restore dependencies | |
run: | | |
dotnet restore ${{ matrix.project }} | |
- name: Build projects | |
run: | | |
dotnet build ${{ matrix.project }} -c Release /p:CI=false --no-restore | |
- name: Run tests | |
id: run_tests | |
run: | | |
dotnet test ${{ matrix.project }} -c Release \ | |
--logger "console;verbosity=normal" \ | |
--logger "trx" \ | |
--logger html \ | |
--blame \ | |
--blame-hang-timeout 5m \ | |
--results-directory testresults \ | |
--no-restore \ | |
--no-build \ | |
--filter ${{ matrix.filter }} \ | |
/p:CI=false | |
- name: Compress test results | |
if: always() | |
run: | | |
zip -r testresults.zip testresults | |
- name: Upload test results artifact | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: testresults-${{ matrix.name }} | |
path: testresults.zip |