Skip to content

CI

CI #762

Workflow file for this run

name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
# once a day
- cron: "0 0 * * *"
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_VERSION: 9.0.100
# Kill other jobs when we trigger this workflow by sending new commits
# to the PR.
# https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
fantomas-check:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Tool Restore
run: dotnet tool restore
- name: Lint
run: dotnet fantomas -r --check .
build:
runs-on: ubuntu-22.04
needs: ['fantomas-check']
steps:
- name: Checkout repository
uses: actions/checkout@v4
# workaround for https://github.com/actions/runner/issues/2033
- name: ownership workaround
run: git config --global --add safe.directory '*'
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore nuget dependencies
run: dotnet restore Oxpecker.sln
- name: Compile the main solution
run: dotnet build Oxpecker.sln --no-restore
- name: Test the main solution
run: dotnet test Oxpecker.sln --no-restore --no-build