Nullable Updates #351
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: CI | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
# branches: | |
# - master | |
# - feature/** | |
pull_request: | |
types: [opened, synchronize, reopened] | |
env: | |
SOLUTION_FILE: "OLT.Core.sln" | |
SOURCE_DIRECTORY: ${{ github.workspace }} | |
SENDGRID_TMPL_JSON: ${{ secrets.SENDGRID_TMPL_JSON }} | |
SENDGRID_TMPL_TAG: ${{ secrets.SENDGRID_TMPL_TAG }} | |
SENDGRID_TMPL_NODATA: ${{ secrets.SENDGRID_TMPL_NODATA }} | |
SENDGRID_UNSUBSCRIBE_GROUP_ID: ${{ secrets.SENDGRID_UNSUBSCRIBE_GROUP_ID }} | |
SENDGRID_TOKEN: ${{ secrets.SENDGRID_TOKEN }} | |
SMTP_HOST: ${{ secrets.SMTP_HOST }} | |
SMTP_USERNAME: ${{ secrets.SMTP_USERNAME }} | |
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }} | |
SMTP_PORT: ${{ secrets.SMTP_PORT }} | |
SMTP_FROM_ADDRESS: ${{ secrets.SMTP_FROM_ADDRESS }} | |
SMTP_TO_ADDRESS: ${{ secrets.SMTP_TO_ADDRESS }} | |
AZURE_APP_CONFIG_ENDPOINT: ${{ secrets.AZURE_APP_CONFIG_ENDPOINT }} | |
AZURE_APP_CONFIG_CONNECTION_STRING: ${{ secrets.AZURE_APP_CONFIG_CONNECTION_STRING }} | |
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} | |
REDIS_CACHE: ${{ secrets.REDIS_CACHE }} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# node-version: [12.x, 14.x, 16.x] | |
# redis-version: [5, 6, 7] | |
steps: | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- uses: actions/checkout@v3.5.3 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v3.7.0 | |
with: | |
node-version: 16.x | |
- name: Start Redis | |
uses: supercharge/redis-github-action@1.5.0 | |
with: | |
redis-version: 7 | |
- name: Setup .NET Core SDK | |
uses: actions/setup-dotnet@v3.2.0 | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
8.0.x | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v7.0.7 | |
# https://www.seeleycoder.com/blog/sonarqube-with-github-actions-and-net-core-5-x/ | |
# this process reads the .config -> dotnet-tools.json to restore packages | |
- name: Sonarqube Begin | |
run: | | |
dotnet tool restore | |
dotnet tool run dotnet-sonarscanner begin /k:"OuterlimitsTech_olt-dotnet-core" /o:"outerlimitstech" /d:sonar.token=${{ secrets.SONAR_TOKEN }} /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vstest.reportsPaths=**/*.trx /d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml /d:sonar.coverage.exclusions="**Test*.cs" /d:sonar.branch.name=${{ steps.branch-name.outputs.current_branch }} | |
- name: Restore dependencies | |
run: dotnet restore ${{ format('{0}/{1}', env.SOURCE_DIRECTORY, env.SOLUTION_FILE) }} | |
- name: Build | |
run: dotnet build ${{ format('{0}/{1}', env.SOURCE_DIRECTORY, env.SOLUTION_FILE) }} --configuration "Release" --no-restore | |
- name: Test | |
run: dotnet test ${{ format('{0}/{1}', env.SOURCE_DIRECTORY, env.SOLUTION_FILE) }} --no-build --verbosity normal --no-restore --configuration "Release" --collect:"XPlat Code Coverage" --logger "trx;LogFilePrefix=unittests" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover | |
env: | |
ASPNETCORE_ENVIRONMENT: Test | |
DOTNET_ENVIRONMENT: Test | |
- name: Sonarqube end | |
run: dotnet tool run dotnet-sonarscanner end /d:sonar.token=${{ secrets.SONAR_TOKEN }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |