name: Linux CI

on:
  pull_request:
  push:
    branches:
    - master
    paths:
    - '*'
    - '!/docs/*' # Don't run workflow when files are only in the /docs directory

jobs:
  build:
    name: Ubuntu
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v1
    - name: .NET Build
      run: dotnet build Build.csproj -c Release /p:CI=true /clp:ForceConsoleColor
    - name: Start Redis Services
      working-directory: ./tests/RedisConfigs
      run: docker-compose -f docker-compose.yml up -d
    - name: .NET Test
      run: dotnet test Build.csproj -c Release --no-build /p:CI=true
      env:
        EnableTestLogging: true
    - name: .NET Lib Pack
      run: dotnet pack Build.csproj --no-build -c Release /p:Packing=true /p:PackageOutputPath=%CD%\.nupkgs /p:CI=true
