Skip to content

Bump cross-spawn from 7.0.3 to 7.0.5 in /Epsilon.Host.Frontend in the npm_and_yarn group across 1 directory #1818

Bump cross-spawn from 7.0.3 to 7.0.5 in /Epsilon.Host.Frontend in the npm_and_yarn group across 1 directory

Bump cross-spawn from 7.0.3 to 7.0.5 in /Epsilon.Host.Frontend in the npm_and_yarn group across 1 directory #1818

name: Continuous integration
concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true
on:
workflow_call:
outputs:
docker:
description: 'Docker images to build'
value: ${{jobs.config.outputs.docker}}
frontend:
description: 'Frontend location'
value: ${{jobs.config.outputs.frontend}}
pull_request:
workflow_dispatch:
jobs:
config:
name: Load settings
runs-on: ubuntu-20.04
outputs:
docker: ${{ steps.docker.outputs.result }}
frontend: ${{ steps.frontend.outputs.result }}
code-analysis: ${{ steps.analysis.outputs.result }}
steps:
- uses: actions/checkout@v4
- name: Load docker configuration
id: docker
uses: mikefarah/[email protected]
with:
cmd: yq '.docker' .github/CICD-Config.yml -o=json
- run: echo "Docker configuration ${{ steps.docker.outputs.result }}"
- uses: actions/checkout@v4
- name: Load Code analysis configuration
id: analysis
uses: mikefarah/[email protected]
with:
cmd: yq '.code-analysis-languages' .github/CICD-Config.yml -o=json
- run: echo "Code analysis configuration ${{ steps.analysis.outputs.result }}"
- name: Load frontend configuration
id: frontend
uses: mikefarah/[email protected]
with:
cmd: yq '.frontend-location' .github/CICD-Config.yml
- run: echo "Frontend configuration ${{ steps.frontend.outputs.result }}"
changes:
name: Change detection
runs-on: ubuntu-20.04
needs: [ config ]
permissions:
pull-requests: read
contents: read
outputs:
backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref_name }}
filters: |
backend:
- '**/*.cs'
- '**/*.csproj'
frontend:
- '${{ needs.config.outputs.frontend}}/**'
build-backend:
name: Build .NET solution
runs-on: ubuntu-20.04
needs: [ changes, config ]
if: ${{ needs.changes.outputs.backend == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
build-frontend:
name: Build frontend
runs-on: ubuntu-20.04
needs: [ changes, config ]
if: ${{ needs.changes.outputs.frontend == 'true' }}
defaults:
run:
working-directory: '${{ needs.config.outputs.frontend }}'
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '${{ needs.config.outputs.frontend}}/pnpm-lock.yaml'
- name: Install modules
run: pnpm install
- name: Build
run: pnpm build
lint-frontend:
name: Lint and format frontend
runs-on: ubuntu-20.04
needs: [ build-frontend, config ]
if: ${{ needs.changes.outputs.frontend == 'true' }}
defaults:
run:
working-directory: '${{ needs.config.outputs.frontend }}'
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '${{ needs.config.outputs.frontend}}/pnpm-lock.yaml'
- name: Install modules
run: pnpm install
- name: Perform linter
run: pnpm run lint
unit-testing:
name: Unit testing
permissions:
pull-requests: write
contents: read
runs-on: ubuntu-20.04
needs: [ build-backend ]
if: ${{ needs.changes.outputs.backend == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test with the dotnet CLI
run: dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: coverage/**/coverage.cobertura.xml
badge: true
fail_below_min: false # Set to true when tests are added to the project.
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '90 90'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
build-docker:
name: Build Docker
runs-on: ubuntu-20.04
needs: [ config, changes ]
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.config.outputs.docker)}}
steps:
- uses: actions/checkout@v4
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
push: false
file: ${{ matrix.file }}
code-analysis:
name: Code analysis
needs: [ changes, config ]
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
if: ${{ needs.config.outputs.code-analysis != 'false' }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ${{fromJson(needs.config.outputs.code-analysis)}}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
if: ${{ matrix.language != null }}
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v3
if: ${{ matrix.language != null }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
if: ${{ matrix.language != null }}
with:
category: "/language:${{matrix.language}}"
cleanup:
runs-on: ubuntu-20.04
if: ${{ always() }}
needs: [ build-frontend, build-backend, lint-frontend, unit-testing, build-docker, code-analysis ]
steps:
- name: Checkout repository
uses: actions/checkout@v4