Linux #2158
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: Linux | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: 1 1 * * * | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Generate help | |
run: dotnet run --project Sanara.Help/Sanara.Help.csproj | |
- name: Publish Sanara | |
run: dotnet publish -c Release -r linux-x64 -o Release Sanara/Sanara.csproj /p:DefineConstants=TRACE%3BNSFW_BUILD | |
- name: Publish Sanara SFW version | |
run: dotnet publish -c Release-SFW -r linux-x64 -o Release-SFW Sanara/Sanara.csproj /p:DefineConstants=TRACE | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Help | |
path: ./Help.json | |
retention-days: 2 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Sanara | |
path: ./Release | |
retention-days: 2 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Sanara-SFW | |
path: ./Release-SFW | |
retention-days: 2 | |
- name: Test | |
run: dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage" | |
- name: Copy coverage | |
run: sh copy_coverage.sh | |
- name: Upload coverage to Codacy | |
uses: codacy/codacy-coverage-reporter-action@master | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: coverage.xml | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 |