vlang / setup-v

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Format verification fails on GHA runner

kevinmatthes opened this issue · comments

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.