fixing integration tests #3
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
| name: Build and Test Docker Images | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore ModularMonolith.sln | |
| - name: Build solution | |
| run: dotnet build ModularMonolith.sln --no-restore --configuration Release | |
| - name: Run tests | |
| run: dotnet test ModularMonolith.sln --no-build --configuration Release --logger "trx;LogFileName=test_results.trx" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build ECommerceApp Docker image | |
| run: | | |
| if [ -f ./ECommerceApp/Dockerfile ]; then | |
| docker build -t ecommerceapp:latest ./ECommerceApp | |
| else | |
| echo "ECommerceApp Dockerfile not found, skipping build." | |
| fi | |
| - name: Build ECommerce.AdminUI Docker image | |
| run: | | |
| if [ -f ./ECommerce.AdminUI/Dockerfile ]; then | |
| docker build -t ecommerceadminui:latest ./ECommerce.AdminUI | |
| else | |
| echo "ECommerce.AdminUI Dockerfile not found, skipping build." | |
| fi |