Skip to content

Commit

Permalink
7th commit
Browse files Browse the repository at this point in the history
  • Loading branch information
umairsafdar768 committed Aug 22, 2024
1 parent f4bac98 commit 3a66d70
Showing 1 changed file with 7 additions and 119 deletions.
126 changes: 7 additions & 119 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,136 +14,24 @@ 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

- name: Run tests
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/[email protected]
# 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/[email protected]
# 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 }}
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

0 comments on commit 3a66d70

Please sign in to comment.