Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesnt seem to run in github action #601

Open
C0DK opened this issue Jul 2, 2023 · 7 comments
Open

Doesnt seem to run in github action #601

C0DK opened this issue Jul 2, 2023 · 7 comments

Comments

@C0DK
Copy link

C0DK commented Jul 2, 2023

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
@knocte
Copy link
Collaborator

knocte commented Nov 29, 2023

How are you installing fsharplint?

@C0DK
Copy link
Author

C0DK commented Nov 30, 2023

How are you installing fsharplint?

like this

dotnet tool install dotnet-fsharplint

@knocte
Copy link
Collaborator

knocte commented Dec 6, 2023

@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.)

@C0DK
Copy link
Author

C0DK commented Dec 6, 2023

@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

@knocte
Copy link
Collaborator

knocte commented Dec 9, 2023

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

@C0DK
Copy link
Author

C0DK commented Dec 11, 2023

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

@knocte
Copy link
Collaborator

knocte commented Dec 30, 2023

@C0DK can I have access to the repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants