0

如何能够在 codecov + display the badge 上记录测试覆盖率?我的存储库是公开的,所以我通常不需要 codecov_token。但是,我确实添加了,因为我已经用完了解决方案来使其工作,我已经在 codecov 仪表板上链接了存储库目标。然而,什么也没显示。

有人可以帮我解决这个问题。为什么存储库不与 codecov 同步?

我错过了什么?到目前为止,我在下面的 .yml 中没有找到解决方案:

name: CI/CD

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [12.x]

    steps:
    - name: Checkout repository
      uses: actions/checkout@v2

    - name: Set up Node.js ${{ matrix.noede-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}

  
    
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2 # Check out your repository
    - name: Install dependencies
      run: npm install
    
    - name: Install truffle
      run: npm install --save-dev truffle
    - run: yarn # Install dependencies
    - run: yarn test --coverage # Run test
    - run: bash <(curl -s https://codecov.io/bash) # Upload to Codecov
    - name: Run the tests and generate coverage report
      run: npx truffle test 
4

0 回答 0