Skip to content

Commit

Permalink
push
Browse files Browse the repository at this point in the history
  • Loading branch information
KsiProgramming committed Nov 27, 2024
1 parent 310505d commit 75c0a7f
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 20 deletions.
119 changes: 99 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,111 @@
name: Build & Test
name: Build

on:
workflow_call:
inputs:
dotnet-version:
type: string
required: true
default: 8.0.x
on: [push, pull_request]

jobs:
build:
name: "Build, Test, Analyze and Publish"
runs-on: windows-latest

runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Cache .nuke/temp
uses: actions/cache@v4
with:
path: |
.nuke/temp
key: ${{ runner.os }}-${{ hashFiles('NodeVersion') }}

- name: Run NUKE
run: ./build.ps1
env:
NuGetApiKey: ${{ secrets.NUGETAPIKEY }}

- name: Check for 'lcov.info' existence
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "TestResults/reports/lcov.info"

- name: coveralls
uses: coverallsapp/github-action@v2
if: steps.check_files.outputs.files_exists == 'true'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: TestResults/reports/lcov.info

- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: windows-artifacts
path: |
./Artifacts/*
./TestResults/*.trx
only-unit-tests:
name: "Run Unit Tests Only"
strategy:
matrix:
os: [ubuntu-24.04, macos-15]

runs-on: ${{ matrix.os }}

steps:
- name: Chceckout code
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ inputs.dotnet-version }}
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Run NUKE
run: ./build.sh UnitTests

- name: Build code
run: dotnet build --no-restore
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-artifacts
path: |
./TestResults/*.trx
publish-test-results:
name: "Publish Tests Results"
needs: [ build, only-unit-tests ]
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
if: always()

steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Test code
run: dotnet test --no-build --verbosity normal
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
comment_mode: always
files: "artifacts/**/**/*.trx"
50 changes: 50 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "CodeQL"

on:
push:
branches: [ "develop", "main" ]
pull_request:
branches: [ "develop", "main" ]
schedule:
- cron: '00 15 * * 1'

jobs:
analyze:
name: Analyze
runs-on: 'ubuntu-latest'
timeout-minutes: 360
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- name: Build
run: |
dotnet restore FluentAssertions.sln --configfile nuget.config
dotnet build FluentAssertions.sln --configuration CI --no-restore
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

0 comments on commit 75c0a7f

Please sign in to comment.