Skip to content

Trying out gha to run tests #37

Trying out gha to run tests

Trying out gha to run tests #37

Workflow file for this run

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
- project: tests/Aspire.Hosting.PostgreSQL.Tests/Aspire.Hosting.PostgreSQL.Tests.csproj
name: PostgreSQL
- project: tests/Aspire.Hosting.Oracle.Tests/Aspire.Hosting.Oracle.Tests.csproj
name: Oracle
- project: tests/Aspire.Hosting.Kafka.Tests/Aspire.Hosting.Kafka.Tests.csproj
name: Kafka
- project: tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj
name: Hosting
- project: tests/Aspire.Hosting.Redis.Tests/Aspire.Hosting.Redis.Tests.csproj
name: Redis
# 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 \
/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