Add Renovate bot #34
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 devStore | |
| on: | |
| push: | |
| paths: | |
| - 'global.json' | |
| - 'src/**' | |
| - '.github/**' | |
| branches: | |
| - main | |
| pull_request: | |
| paths: | |
| - 'global.json' | |
| - 'src/**' | |
| - '.github/**' | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| versioning: | |
| name: Versioning | |
| runs-on: ubuntu-latest | |
| outputs: | |
| TAG: ${{ steps.tagging.outputs.TAG }} | |
| steps: | |
| - name: Tagging | |
| id: tagging | |
| run: | | |
| if [ "${GITHUB_REF}" == "refs/heads/main" ]; then | |
| echo "TAG=latest" >> $GITHUB_OUTPUT | |
| else | |
| echo "TAG=preview" >> $GITHUB_OUTPUT | |
| fi | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| needs: versioning | |
| services: | |
| mssql: | |
| image: mcr.microsoft.com/mssql/server:2022-latest | |
| ports: | |
| - 1433:1433 | |
| env: | |
| ACCEPT_EULA: "Y" | |
| SA_PASSWORD: ${{ secrets.TEST_DB_SA_PASSWORD }} | |
| options: --health-cmd="exit 0" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| rabbitmq: | |
| image: masstransit/rabbitmq | |
| ports: | |
| - 5672:5672 | |
| env: | |
| RABBITMQ_DEFAULT_USER: "devstore" | |
| RABBITMQ_DEFAULT_PASS: ${{ secrets.TEST_RABBITMQ_PASSWORD }} | |
| env: | |
| TAG: ${{ needs.versioning.outputs.TAG }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build solution | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Run tests | |
| run: dotnet test --no-build --no-restore --configuration Release --logger "console;verbosity=detailed" --logger trx --results-directory "TestResults" | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dotnet-test-results | |
| path: ./src/TestResults | |
| build-docker-image-services: | |
| name: Build docker image services | |
| runs-on: ubuntu-latest | |
| needs: build-and-test | |
| env: | |
| TAG: ${{ needs.versioning.outputs.TAG }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build docker images | |
| working-directory: ./docker | |
| run: | | |
| TAG=${{ env.TAG }} docker compose -f ./docker-compose-local.yml build | |
| - name: Push docker images | |
| working-directory: ./docker | |
| run: | | |
| TAG=${{ env.TAG }} docker compose -f ./docker-compose-local.yml push |