Skip to content

Format verification fails on GHA runner #6

@kevinmatthes

Description

@kevinmatthes

Hello and thank you for this Action!

I would like to inform you about a strange behaviour I encountered when applying this Action in a CI workflow of a project which only contains a single V source file within a directory, src/main.v. With this Action, I would like to verify that the code of that source file compiles as well as that it is formatted properly; the source file is just the default "Hello World" example from v init and starts with a GPL-3.0 license header, so it is obviously correct.

With V being installed from source on my local machine, I can compile and verify the formatting without any problems but as soon as I try to v fmt -verify . on the runner, the job fails with an error message indicating that the submodule example of the V repository would not be formatted correctly. Despite this file not belonging to my code base at all, I cannot reproduce the formatting error message on my local machine where I use the very same V version since my formatter tells me that the example source file would be formatted correctly. A workaround is to check the format with v fmt -verify src/ on the runner instead.

My CI workflow file is defined as follows, I skipped the workflow jobs which are not related to the described bug:

name: ci

on:
  pull_request:
  push:

permissions:
  contents: read

jobs:
  # ...
  v:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3.5.3
        with:
          persist-credentials: false

      - uses: vlang/setup-v@v1.3
        with:
          check-latest: true

      - run: v ${{ matrix.v }}
    strategy:
      matrix:
        v:
          - .
          - fmt -verify src/ # Change this to `fmt -verify .` to see the bug.

I am not sure where to report this strange bug but as it shows up when applying this Action, I assumed you should know about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions