Bump the testing group across 1 directory with 3 updates #1471
Workflow file for this run
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: Docker | |
| on: | |
| push: | |
| tags: | |
| - v* | |
| branches: | |
| - develop | |
| pull_request: | |
| env: | |
| IMAGE_NAME: OpenAlprWebhookProcessor | |
| jobs: | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'push' || !contains(github.ref, 'refs/tags/') | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Run build | |
| run: docker build . --file ./OpenAlprWebhookProcessor.Server/Dockerfile | |
| build-test-analyze: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'push' || !contains(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: 'zulu' | |
| - name: Setup .NETf | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 9.x | |
| - name: Install SonarQube Cloud scanner | |
| run: | | |
| dotnet tool install --global dotnet-sonarscanner | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Start SonarQube Analysis | |
| run: | | |
| dotnet-sonarscanner begin \ | |
| /k:"mlapaglia_OpenAlprWebhookProcessor" \ | |
| /o:"openalprwebhookprocessor" \ | |
| /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ | |
| /d:sonar.cs.opencover.reportsPaths="coverage/**/coverage.opencover.xml" \ | |
| /d:sonar.javascript.lcov.reportPaths="**/lcov.info" \ | |
| /d:sonar.exclusions="**/Data/Migrations/**,**/Infrastructure/Extensions/ServiceCollectionExtensions.cs" | |
| - name: Build and Test Backend | |
| run: | | |
| dotnet restore | |
| dotnet build --no-restore | |
| dotnet test --no-build --collect:"XPlat Code Coverage;Format=opencover" --results-directory ./coverage | |
| - name: Build and Test Frontend | |
| working-directory: ./openalprwebhookprocessor.client | |
| run: | | |
| npm ci | |
| npm run test:prod | |
| - name: End SonarQube Analysis | |
| run: | | |
| dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" | |
| front-end-lint: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'push' || !contains(github.ref, 'refs/tags/') | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Run frontend lint | |
| working-directory: ./openalprwebhookprocessor.client | |
| run: | | |
| npm ci | |
| npm run lint | |
| windows-build-push: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@main | |
| - name: Setup Buildx | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: '9.x' | |
| include-prerelease: true | |
| - name: Build Artifact | |
| run: | | |
| tag=$(git describe --tags --abbrev=0) | |
| version=${tag#v} # Remove 'v' prefix (e.g., 6.0.0-alpha25) | |
| numeric_version=$(echo "$version" | sed 's/-.*//') # Extract numeric part (e.g., 6.0.0) | |
| assembly_version="${numeric_version}.0" # Make it 4-part numeric (e.g., 6.0.0.0) | |
| release_name="OpenAlprWebHookProcessor-${tag}-windows64" | |
| dotnet restore "OpenAlprWebhookProcessor.Server/OpenAlprWebhookProcessor.Server.csproj" | |
| dotnet build "OpenAlprWebhookProcessor.Server/OpenAlprWebhookProcessor.Server.csproj" -c Release \ | |
| -p:GitVersion="$version" \ | |
| -p:GitAssemblyVersion="$assembly_version" \ | |
| -p:GitFileVersion="$assembly_version" | |
| dotnet publish "OpenAlprWebhookProcessor.Server/OpenAlprWebhookProcessor.Server.csproj" -c Release -o "$release_name" \ | |
| -r win-x64 --self-contained false \ | |
| -p:GitVersion="$version" \ | |
| -p:GitAssemblyVersion="$assembly_version" \ | |
| -p:GitFileVersion="$assembly_version" | |
| tar czvf "${release_name}.tar.gz" "$release_name" | |
| - name: Publish | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: "OpenAlprWebHookProcessor*" | |
| prerelease: ${{ contains(github.ref, 'alpha') }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| docker-build-push: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| - name: Get git tag and version | |
| id: get_version | |
| run: | | |
| tag=${GITHUB_REF/refs\/tags\//} | |
| version=${tag#v} # Remove 'v' prefix (e.g., 6.0.0-alpha25) | |
| numeric_version=$(echo "$version" | sed 's/-.*//') # Extract numeric part (e.g., 6.0.0) | |
| assembly_version="${numeric_version}.0" # Make it 4-part numeric (e.g., 6.0.0.0) | |
| echo "VERSION=$tag" >> $GITHUB_OUTPUT | |
| echo "GIT_VERSION=$version" >> $GITHUB_OUTPUT | |
| echo "ASSEMBLY_VERSION=$assembly_version" >> $GITHUB_OUTPUT | |
| - name: Push to Docker Hub | |
| uses: docker/build-push-action@v5 | |
| with: | |
| build-args: | | |
| GIT_VERSION=${{ steps.get_version.outputs.GIT_VERSION }} | |
| GIT_ASSEMBLY_VERSION=${{ steps.get_version.outputs.ASSEMBLY_VERSION }} | |
| GIT_FILE_VERSION=${{ steps.get_version.outputs.ASSEMBLY_VERSION }} | |
| file: ./OpenAlprWebhookProcessor.Server/Dockerfile | |
| push: true | |
| tags: | | |
| mlapaglia/openalprwebhookprocessor:${{ steps.get_version.outputs.VERSION }} | |
| ${{ contains(github.ref, 'alpha') && 'mlapaglia/openalprwebhookprocessor:alpha' || 'mlapaglia/openalprwebhookprocessor:latest' }} |