Merge pull request #98 from SunriseCommunity/feat/minor-enchancements #633
This file contains hidden or 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
| on: [push] | |
| name: .NET Build and Test CI | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| env: | |
| ASPNETCORE_ENVIRONMENT: Tests | |
| WEB_DOMAIN: sunrise.local | |
| API_TOKEN_SECRET: SilentMoonCove | |
| OBSERVATORY_HOST: jsonplaceholder.typicode.com | |
| OBSERVATORY_PORT: 80 | |
| MYSQL_HOST: localhost | |
| MYSQL_PORT: 3318 | |
| MYSQL_USER: root | |
| MYSQL_PASSWORD: root | |
| MYSQL_DATABASE: test | |
| HANGFIRE_HOST: localhost | |
| HANGFIRE_PORT: 3318 | |
| HANGFIRE_USER: root | |
| HANGFIRE_PASSWORD: root | |
| REDIS_HOST: localhost | |
| REDIS_PORT: 6339 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Docker compose test environment | |
| run: docker compose -f docker-compose.tests.yml up -d | |
| - name: Wait for MySQL to be ready | |
| run: | | |
| while ! docker compose -f docker-compose.tests.yml ps | grep "healthy"; do | |
| echo "Waiting for MySQL..." | |
| sleep 5 | |
| done | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore | |
| - name: Test | |
| run: dotnet test -m:1 --no-build --verbosity normal --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" |