diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8fe1688..a38dcf6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,38 +14,14 @@ jobs: runs-on: ${{matrix.os}} steps: - # - name: Checkout target branch to get old lcov file - # uses: actions/checkout@v2 - # with: - # ref: ${{ github.event.pull_request.base.ref }} - - # - name: Get old lcov file - # run: mv old-lcov/old-lcov.lcov old-lcov.lcov - - # - name: Upload old lcov file - # uses: actions/upload-artifact@v3 - # with: - # name: old-lcov - # path: old-lcov.lcov - - name: Checkout PR branch - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.ref }} - - # - name: Download old lcov file - # uses: actions/download-artifact@v3 - # with: - # name: old-lcov - # path: . + uses: actions/checkout@v4 - name: Set up python uses: actions/setup-python@v4 with: python-version: ${{matrix.python-versions}} - # - name: Install Dependencies - # run: python -m pip install pytest pytest-cov coverage-lcov pytest-json-report - name: Install dependencies run: pip install pytest pytest-cov @@ -53,97 +29,9 @@ jobs: run: pytest --cov - name: Upload results to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - # - name: Run tests - # run: pytest -o junit_family=xunit2 --junitxml result.xml -v --ff --cov=main --cov=additional_func --cov-report=xml --cov-report=term - - # - name: Coverage Report - # if: always() - # uses: aGallea/tests-coverage-report@1.3.1 - # with: - # min-coverage-percentage: '10' - # fail-under-coverage-percentage: 'true' - # cobertura-path: ./coverage.xml - # junit-path: ./result.xml - # - name: Convert schema - # run: coverage xml -o coverage_cobertura.xml - # #test comment, trigger change - - # - name: Make lcov file - # run: coverage lcov -o current-lcov.lcov - - # - name: Make coverage summary file - # run: pytest --json-report --json-report-summary - - # - name: Rename and relocate it - # run: mkdir coverage && mv .report.json coverage/coverage-summary.json - - # - name: Code Coverage Report - # uses: irongut/CodeCoverageSummary@v1.3.0 - # with: - # filename: coverage_cobertura.xml - # badge: true - # fail_below_min: true - # format: markdown - # hide_branch_rate: false - # hide_complexity: true - # indicators: true - # output: both - # thresholds: '30 80' - - # - name: Add Coverage PR Comment - # uses: marocchino/sticky-pull-request-comment@v2 - # if: github.event_name == 'pull_request' - # with: - # recreate: true - # path: code-coverage-results.md - - # - name: Generate Code Coverage report - # id: code-coverage - # uses: barecheck/code-coverage-action@v1 - # with: - # barecheck-github-app-token: ${{ secrets.BARECHECK_GITHUB_APP_TOKEN }} - # lcov-file: "current-lcov.lcov" - # base-lcov-file: "old-lcov.lcov" - # #minimum-ratio: 0 # Fails Github action once code coverage is decreasing - # send-summary-comment: true - # show-annotations: "warning" # Possible options warning|error - - # - name: Coverage Diff - # uses: greatwizard/coverage-diff-action@v1 - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - - # - name: Upload current lcov file - # uses: actions/upload-artifact@v3 - # with: - # name: current-lcov - # path: current-lcov.lcov - - # - name: Checkout target branch again - # uses: actions/checkout@v2 - # with: - # ref: ${{ github.event.pull_request.base.ref }} - # fetch-depth: 0 - - # - name: Download current lcov file - # uses: actions/download-artifact@v3 - # with: - # name: current-lcov - # path: . - - # - name: Copy new lcov file to target branch - # run: mv current-lcov.lcov old-lcov/old-lcov.lcov - - # - name: Commit and push changes - # run: | - # git config --global user.name 'github-actions[bot]' - # git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' - # git add . - # git commit -m 'Update lcov file with new coverage data' - # git push - # env: - # GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} \ No newline at end of file + run: | + # Replace `linux` below with the appropriate OS + # Options are `alpine`, `linux`, `macos`, `windows` + curl -Os https://cli.codecov.io/latest/linux/codecov + chmod +x codecov + ./codecov --verbose upload-process --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} -n 'service'-${{ github.run_id }} -F service -f coverage-service.xml