FSharpLint icon indicating copy to clipboard operation
FSharpLint copied to clipboard

Doesnt seem to run in github action

Open C0DK opened this issue 2 years ago • 7 comments

Description

I am running lint in a CI pipeline in a github action, but it reports none of the warnings I get on my local machine - it reports zero warnings.

Repro steps

Please provide the steps required to reproduce the problem

name: ModelRegistry

on:
  push:
    branches: ["main"]
  pull_request:
    branches: ["main"]

defaults:
  run:
    working-directory: src/ModelRegistry

jobs:
  qa:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - name: Setup .NET
        uses: actions/setup-dotnet@v2
        with:
          dotnet-version: 6.0.x
      - name: Install tools
        run: make install
      - name: Build
        run: make build
      - name: Test
        run: make test
      - name: Validate format
        run: make check-format

and relevant make command:

.PHONY: check-format 
check-format: ## check if code is correctly formatted
	dotnet fantomas --check .
	dotnet fsharplint lint ModelRegistry.sln 
	ls

(the ls to check the files exist in the action).

Expected behavior

From my machine:

❯ make check-format
dotnet fantomas --check .
dotnet fsharplint lint ModelRegistry.sln 
[...]
========== Summary: 32 warnings ==========
make: *** [Makefile:16: check-format] Error 255

Actual behavior

Run make check-format
dotnet fantomas --recurse --check .
dotnet fsharplint lint ModelRegistry.sln 
========== Summary: 0 warnings ==========
ls
[...]
ModelRegistry.sln
[...]

Known workarounds

N/A

Related information

Everything should be in github action yml content.

  • linter Version: 0.21.3

C0DK avatar Jul 02 '23 13:07 C0DK

How are you installing fsharplint?

knocte avatar Nov 29 '23 12:11 knocte

How are you installing fsharplint?

like this

dotnet tool install dotnet-fsharplint

C0DK avatar Nov 30 '23 13:11 C0DK

@C0DK maybe this is the culprit?:

defaults: run: working-directory: src/ModelRegistry

It's the only difference I can think of between your local env and CI. (Even if I'm right, I know that FSharpLint should probably throw a better error here, but let's find the real issue first.)

knocte avatar Dec 06 '23 10:12 knocte

@C0DK maybe this is the culprit?:

defaults: run: working-directory: src/ModelRegistry

It's the only difference I can think of between your local env and CI. (Even if I'm right, I know that FSharpLint should probably throw a better error here, but let's find the real issue first.)

The makefile is in that working directory, so that would be why :D

C0DK avatar Dec 06 '23 16:12 C0DK

But how about the .sln file, where does it live?

knocte avatar Dec 09 '23 04:12 knocte

Same folder. it's a mono repo of mulitple projects.

C0DK avatar Dec 11 '23 10:12 C0DK

@C0DK can I have access to the repo?

knocte avatar Dec 30 '23 00:12 knocte