Skip to content

Better support for go submodules #74

Open
@8tomat8

Description

@8tomat8

Context:
We have a repository which has a structure similar to

- root module
-- pkgA submodule
-- pkgB submodule
-- etc...

root module has no go files.
Each pkg{A,B,...} module has code+tests and separate go.mod+go.sum+vendor files.

Issue:
On every PR we are running

jobs:
  test:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-go@v1
      with:
        go-version: '1.15.x'
    - name: Run tests
      # Go into each folder in the repo and run tests 10 times with the race detector
      run: for d in ./*/ ; do (cd "$d" && go test -race -count 10 ./...); done

  golangci:
    name: lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install golangci-lint
        uses: golangci/golangci-lint-action@v0.2.0
        with:
          version: v1.26
          args: --modules-download-mode vendor --config ./.golangci.yml ./...

But it fails with ERRO Running error: context loading failed: no go files to analyze

Question:
Is there a way to use this action to run linter in all the folders but without creating separate jobs with a matrix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions