觀察開源專案如何사용 codecov

7176 단어
Codecov提供開源專案免費使用codecov資源,幫助紀錄每一次commit的測試覆蓋率變化.

開源專案



아파치/스파크



https://app.codecov.io/gh/apache/spark

빌드 및 테스트:

    - name: Upload coverage to Codecov
      if: inputs.type == 'pyspark-coverage-scheduled'
      uses: codecov/codecov-action@v2
      with:
        files: ./python/coverage.xml
        flags: unittests
        name: PySpark


아파치/슈퍼세트



https://app.codecov.io/gh/apache/superset

Python 통합:

      - name: Python integration tests (SQLite)
        if: steps.check.outcome == 'failure'
        run: |
          ./scripts/python_tests.sh
      - name: Upload code coverage
        if: steps.check.outcome == 'failure'
        run: |
          bash .github/workflows/codecov.sh -c -F python -F sqlite


Python 단위:

      - name: Python unit tests
        if: steps.check.outcome == 'failure'
        run: |
          pytest --durations-min=0.5 --cov-report= --cov=superset ./tests/common ./tests/unit_tests --cache-clear
      - name: Upload code coverage
        if: steps.check.outcome == 'failure'
        run: |
          bash .github/workflows/codecov.sh -c -F python -F unit


아파치/rocketmq



https://app.codecov.io/gh/apache/rocketmq

적용 범위:

      - name: Generate coverage report
        run: mvn -B test -T 2C --file pom.xml
      - name: Upload to Codecov
        uses: codecov/codecov-action@v3
        with:
          fail_ci_if_error: true
          verbose: true


정력/정력



https://app.codecov.io/gh/vim/vim

깃허브 CI:

      - name: Test
        timeout-minutes: 20
        run: |
          do_test() { sg audio "sg $(id -gn) '$*'"; }
          do_test make ${SHADOWOPT} ${TEST}
      # - name: Coveralls
      #   if: matrix.coverage && github.event_name != 'pull_request'
      #   env:
      #     COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
      #     COVERALLS_PARALLEL: true
      #     TRAVIS_JOB_ID: ${{ github.run_id }}
      #   run: |
      #     sudo apt-get install -y python3-setuptools python3-wheel
      #     sudo -H pip3 install pip -U
      #     # needed for https support for coveralls building cffi only works with gcc, not with clang
      #     CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
      #     ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8

      - name: Generate gcov files
        if: matrix.coverage
        run: |
          cd "${SRCDIR}"
          find . -type f -name '*.gcno' -exec gcov -pb {} + || true
      - name: Codecov
        if: matrix.coverage
        uses: codecov/[email protected]
        with:
          flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}


파이썬/사이파이썬



cpython이 사용하지 않는 codecov의 출처: https://github.com/python/cpython/issues/83958

좋은 웹페이지 즐겨찾기