GitHub Action that uploads returns selected test labels to CI ☂️
This Action is currently in beta. Currently, it has only been tested on linux
and macos
builds using python
and pytest
.
If you have feedback or issues with running this action, please don't hesitate to let us know by creating a Github Issue against this repo.
checkout
step in GitHub actions to include fetch-depth: 0
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
CODECOV_TOKEN
and CODECOV_STATIC_TOKEN
secrets from the Codecov UI to GitHub. You can find the CODECOV_STATIC_TOKEN
as the Static analysis token
Set the Static analysis token to CODECOV_STATIC_TOKEN
in your repository secrets.
codecov.yml
by adding the followingflag_management: individual_flags: - name: smart-tests carryforward: true carryforward_mode: "labels" statuses: - type: "project" - type: "patch" cli: plugins: pycoverage: report_type: "json"
pytest-cov
is not a dependency, add it to your requirements.txt
file, or run the following after you install your python dependencies in your GitHub Actions workflow.- name: Install pytest run: pip install pytest-cov
codecov_ats
folder with the tests to run.- name: Run ATS uses: codecov/codecov-ats@v0 env: CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # This is an example, do not copy below. # - name: Run tests. # run: pytest ...
pytest
run to include the tests selected from ATS. You will read the list of tests that were selected to run by ATS. These tests are exported to codecov_ats/tests_to_run.txt
. Skips running tests if no tests were selected. (You can copy the same step and use the codecov_ats/tests_to_skip.txt
file to run the tests selected to be skipped)- name: Run tests and collect coverage run: | cat codecov_ats/tests_to_run.txt | xargs pytest --cov app
v4-beta
- name: Upload coverage to Codecov uses: codecov/codecov-action@v4-beta env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: flags: smart-tests plugins: pycoverage,compress-pycoverage
This action creates a codecov_ats
folder in the current directory and populates it with 3 files:
codecov_ats/tests_to_run.json
- List of tests selected by Automated Test Selection that should be executedcodecov_ats/tests_to_skip.json
- List of tests that are being skipedcodecov_ats/result.json
- Summary of results for test selectionRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4