davelosert/vitest-coverage-report-action

Unable to find config file ".//".

Closed this issue ยท 2 comments

Error ci

Run davelosert/vitest-coverage-report-action@v2
  with:
    working-directory: ./
    github-token: ***
    json-summary-path: coverage/coverage-summary.json
    file-coverage-mode: changes
    json-final-path: coverage/coverage-final.json
Error: Failed to read vite config file".//" or any of the default locations.
Make sure you provide the vite-config-path option if you're using a non-default location or name of your config file.
Error: Error: Unable to find config file ".//".

My config

name: Main

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

permissions:
  pull-requests: write
  contents: read

on:
  push:
    branches:
      - main

  pull_request:
    branches:
      - main

jobs:
  build-test:

    name: ๐Ÿ“š Main
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-latest]

    steps:
      - uses: actions/checkout@v3

      - name: Cache turbo build setup
        uses: actions/cache@v3
        with:
          path: .turbo
          key: ${{ runner.os }}-turbo-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-turbo-

      - run: corepack enable
      - uses: actions/setup-node@v3
        with:
          node-version: '18'
          cache: pnpm

      - name: ๐Ÿ“ฆ Install dependencies
        run: pnpm install --frozen-lockfile

      - name: ๐Ÿงช Server Test
        run: pnpm test:server
        env:
          VITE_TEST_DB_URL: postgres://postgres:postgres@127.0.0.1:5432

      - name: ๐Ÿงช Server Test Coverage
        run: pnpm test:server:cov
        env:
          VITE_TEST_DB_URL: postgres://postgres:postgres@127.0.0.1:5432

      - name: ๐Ÿ“ Upload coverage
        if: always()
        uses: davelosert/vitest-coverage-report-action@v2
        with:
          working-directory: './'

Hi @productdevbook,

thank you for reporting this. The error message is a bit misleading - but it basically tells you that there wasn't a vite-config in the root-path of your repository. Right now, having a vite-config is required for this library to read the coverage-thresholds.

However, I realized that this action could also work fine without coverage-thresholds, and, as such, without a vite-config present. So I will change this to only be a warning and adjust the warning message to be more precise.

๐ŸŽ‰ This issue has been resolved in version 2.1.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€