Skip to content

πŸ’Ž Code Quality #373

πŸ’Ž Code Quality

πŸ’Ž Code Quality #373

Workflow file for this run

---
name: 'πŸ’Ž Code Quality'
on:
workflow_dispatch:
workflow_call:
schedule:
# Run every monday at 0200UTC
- cron: "0 2 * * 1"
push:
branches-ignore: [master, main]
# Remove the line above to run when pushing to master
pull_request:
branches: [master, main]
env:
DOTNET_VERSION: '6.x.x'
jobs:
code_quality:
name: 'πŸ› οΈ Build & πŸ§ͺ Test'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: πŸ“¦ Restore dependencies
run: dotnet restore -r linux-x64 datasheetapi/ && dotnet restore -r linux-x64 tests/
- name: πŸ› οΈ Build Solution
run: dotnet build datasheetapi --configuration Release && dotnet build tests --configuration Release
- name: πŸ§ͺ Run Tests
run: dotnet test tests --configuration Release
security_vulnerabilities:
name: 🚨 Security vulnerabilities
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: πŸ“¦ Restore dependencies
run: dotnet restore -r linux-x64 datasheetapi/ && dotnet restore -r linux-x64 tests/
- name: πŸ› οΈ Build Solution
run: dotnet build datasheetapi --configuration Release && dotnet build tests --configuration Release
- uses: actions/checkout@master
- run: echo ${{ secrets.GITHUB_TOKEN }}
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/dotnet@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: |
--severity-threshold=high --file=/home/runner/work/spinedatasheetapi/spinedatasheetapi/datasheetapi/datasheetapi.csproj
lint:
name: πŸ’… Linting
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Lint Code Base
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}