Bump romeovs/lcov-reporter-action from 0.3.1 to 0.4.0 #12
Workflow file for this run
This file contains 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: Run tests with coverage | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# ! Replace DotnetProject and dotnet-project with project name in real repository | |
env: | |
PROJECT_NAME: DotnetProject | |
PROJECT_NAME_LOWER: dotnet-project | |
jobs: | |
validate_commit: | |
name: Validate commit | |
runs-on: ubuntu-latest | |
if: ${{ github.ref != 'refs/heads/main' }} | |
permissions: | |
id-token: write # required for dependabot PRs | |
pull-requests: write # required for dependabot PRs | |
contents: read # required for dependabot PRs | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4.0.0 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
env: | |
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
working-directory: ./test | |
run: | | |
dotnet add package coverlet.msbuild && | |
dotnet test ${PROJECT_NAME}Tests.csproj --configuration Debug --runtime linux-x64 /p:CollectCoverage=true /p:CoverletOutput=Coverage/ /p:CoverletOutputFormat=lcov --logger GitHubActions | |
- name: Publish Code Coverage | |
if: ${{ github.event_name == 'pull_request' && always() }} | |
uses: romeovs/lcov-reporter-action@v0.4.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
lcov-file: ./test/Coverage/coverage.info | |
build_image: | |
name: Build Docker Image and Helm Charts | |
runs-on: ubuntu-latest | |
needs: [ validate_commit ] | |
# Remove the line below and uncomment the next one | |
if: ${{ false }} | |
# if: ${{ always() && (needs.validate_commit.result == 'success' || needs.validate_commit.result == 'skipped') }} | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3.2.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get project version | |
uses: SneaksAndData/github-actions/generate_version@v0.1.8 | |
id: version | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=semver,pattern={{version}},value=${{steps.version.outputs.version}} | |
flavor: | |
latest=false | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3.3.0 | |
with: | |
use: true | |
platforms: linux/arm64,linux/amd64 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5.3.0 | |
with: | |
context: . | |
file: .container/Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/arm64,linux/amd64 | |
- name: Build and Push Chart | |
uses: SneaksAndData/github-actions/build_helm_chart@v0.1.8 | |
with: | |
application: arcane-stream-sqlserver-change-tracking | |
app_version: ${{ steps.meta.outputs.version }} | |
container_registry_user: ${{ github.actor }} | |
container_registry_token: ${{ secrets.GITHUB_TOKEN }} | |
container_registry_address: ghcr.io/sneaksanddata/ |