Skip to content

Commit

Permalink
Update CI config (#383)
Browse files Browse the repository at this point in the history
* Update CI config

Updating CI config:

- better separate operations in `codecovstartup`;
- don't call `create-commit` and `create-report` twice;
- actually make use of label-analysis with a dedicated flag

* Use latest release of CLI, not unreleased version
  • Loading branch information
giovanni-guidini authored Jun 9, 2023
1 parent 3565648 commit 76e96b7
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 31 deletions.
83 changes: 52 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@ version: 2.1

jobs:
codecovstartup:
docker:
- image: circleci/python:3.10.1
steps:
- run:
name: Install CLI
command: |
pip install codecov-cli
- run:
name: Save commit info
command: |
codecovcli create-commit
- run:
name: Create report
command: |
codecovcli create-report
staticanalysis:
docker:
- image: circleci/python:3.10.1
steps:
- checkout
- run:
name: Install CLI
command: |
pip install codecov-cli
- run:
# Adding this because we're getting 404 consistently
# When calling just static-analysis
# Not sure if this fixes it, but hoping it does
name: Save commit info
command: |
codecovcli create-commit
- run:
name: Run Static Analysis
command: |
codecovcli static-analysis --token=$STATIC_TOKEN
labelanalysis:
docker:
- image: circleci/python:3.10.1
steps:
Expand All @@ -20,28 +56,17 @@ jobs:
name: Install CLI
command: |
. venv/bin/activate
pip install git+ssh://[email protected]/codecov/[email protected]#egg=codecov-cli
pip install codecov-cli
- run:
name: Save commit info
command: |
. venv/bin/activate
codecovcli create-commit
- run:
name: Create report
command: |
. venv/bin/activate
codecovcli create-report
- run:
name: Run Static Analysis
name: Run Predictor Analysis
command: |
. venv/bin/activate
codecovcli static-analysis --token=$STATIC_TOKEN
codecovcli label-analysis --token=$STATIC_TOKEN --base-sha=$(git log -n 1 master --pretty=format:"%H")
- run:
name: Run Predictor Analysis
name: Upload smart-labels
command: |
. venv/bin/activate
python -m pytest -q --collect-only
codecovcli label-analysis --token=$STATIC_TOKEN --base-sha=$(git log -n 1 master --pretty=format:"%H")
codecovcli --codecov-yml-path=codecov_cli.yml do-upload --plugin pycoverage --plugin compress-pycoverage --flag smart-labels --fail-on-error
linter:
docker:
- image: circleci/python:3.7.6
Expand Down Expand Up @@ -84,7 +109,6 @@ jobs:
- image: cimg/python:<< parameters.imagename >>
steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
Expand Down Expand Up @@ -116,17 +140,7 @@ jobs:
name: Install CLI
command: |
. venv/bin/activate
pip install git+ssh://[email protected]/codecov/codecov-cli.git@0d8eba604af22aa04f7cdcc521361aecfaec3b47#egg=codecov-cli
- run:
name: Save commit info
command: |
. venv/bin/activate
codecovcli create-commit
- run:
name: Create report
command: |
. venv/bin/activate
codecovcli create-report
pip install codecov-cli
- run:
name: Upload to codecov
command: |
Expand All @@ -152,11 +166,10 @@ jobs:
RUSTFLAGS="-Z instrument-coverage" LLVM_PROFILE_FILE="ribs-%m.profraw" cargo +nightly test --no-default-features
llvm-profdata-15 merge -sparse ribs-*.profraw -o ribs.profdata
llvm-cov-15 show --ignore-filename-regex='/.cargo/registry' --instr-profile=ribs.profdata --object `ls target/debug/deps/ribs-* | grep -v "\.d" | grep -v "\.o"` > app.coverage.txt
pip install git+ssh://[email protected]/codecov/codecov-cli.git@0d8eba604af22aa04f7cdcc521361aecfaec3b47#egg=codecov-cli
- run:
name: Install CLI
command: |
pip install git+ssh://[email protected]/codecov/codecov-cli.git@0d8eba604af22aa04f7cdcc521361aecfaec3b47#egg=codecov-cli
pip install codecov-cli
- run:
name: Save commit info
command: |
Expand All @@ -173,7 +186,6 @@ workflows:
version: 2
lint-test:
jobs:
- codecovstartup
- mutations
- rust:
filters:
Expand All @@ -183,7 +195,16 @@ workflows:
filters:
tags:
only: /.*/
- codecovstartup
- staticanalysis:
requires:
- codecovstartup
- labelanalysis:
requires:
- staticanalysis
- build:
requires:
- codecovstartup
matrix:
parameters:
imagename: ["3.7.13", "3.8.13", "3.9.12", "3.10.5"]
Expand Down
9 changes: 9 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@ ignore:
- "**/conftest.py"
- "**tests**/test_*.py"
- "tests**"

beta_groups:
- "labels"

flag_management:
individual_flags:
- name: "smart-labels"
carryforward: true
carryforward_mode: "labels"
4 changes: 4 additions & 0 deletions codecov_cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cli:
plugins:
pycoverage:
report_type: "json"

0 comments on commit 76e96b7

Please sign in to comment.