engine-bay/admin-portal

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: Continuous Integration

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Setup .NET
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: 8.0.x
    - name: Restore dependencies
      run: dotnet restore
    - name: Build
      run: dotnet build --no-restore
  test:
    needs: [ build ]
    name: Test
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Setup .NET
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: 8.0.x
    - run: dotnet tool restore
    - run: dotnet coverage collect dotnet test --output ./output.cobertura.xml --output-format cobertura
    - run: dotnet reportgenerator -reports:./output.cobertura.xml -targetdir:"." -reporttypes:Clover -assemblyfilters:"-Humanizer;-Microsoft.TestPlatform*;-Microsoft.VisualStudio*;-xunit*;"
    - uses: paambaati/codeclimate-action@v5.0.0
      env:
        CC_TEST_REPORTER_ID: e8d6c7fefa3f9c5a4978e442b64cccb253e6ea21987bdd9ce1ff96f9e4cc2468
      with:
        coverageLocations: ${{github.workspace}}/Clover.xml:clover
  analyze:
    needs: [ build ]
    name: Analyze
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write
    strategy:
      fail-fast: false
      matrix:
        language: [ 'csharp' ]
    steps:
    - name: Checkout repository
      uses: actions/checkout@v3
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v2
      with:
        languages: ${{ matrix.language }}
    - name: Autobuild
      uses: github/codeql-action/autobuild@v2
    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v2
      with:
        category: "/language:${{matrix.language}}"