Skip to content

Commit

Permalink
Merge branch 'master' into es/codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
AndWeHaveAPlan authored May 8, 2024
2 parents feb91ee + 17b56fa commit 5c3a7a0
Show file tree
Hide file tree
Showing 216 changed files with 11,546 additions and 1,447 deletions.
9 changes: 9 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage:
precision: 2
round: down
range: "1...100"
status:
project:
default:
target: 1.0
threshold: 2.0
1 change: 1 addition & 0 deletions .github/workflows/release-30_publish_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ jobs:
post_to_matrix:
runs-on: ubuntu-latest
needs: publish-release-draft
environment: release
strategy:
matrix:
channel:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release-99_notif-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,3 @@ jobs:
Release version: [${{github.event.release.tag_name}}](${{github.event.release.html_url}})
-----
${{github.event.release.body}}
107 changes: 107 additions & 0 deletions .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,113 @@
- job: job-starter
artifacts: false

#
#
#
.codecov-check:
script:
- >
if command -v codecovcli -h >/dev/null 2>&1; then
codecovcli --version;
else
echo "downloading codecovcli";
curl -s -o codecovcli https://cli.codecov.io/latest/linux/codecov;
chmod +x codecovcli;
mv codecovcli /usr/local/bin/codecovcli;
fi
#
- codecovcli --version

#
#
#
codecov-start:
stage: test
when: manual
allow_failure: false
extends:
- .kubernetes-env
- .common-refs
- .pipeline-stopper-artifacts
- .run-immediately
script:
- !reference [.codecov-check, script]
- >
if [ "$CI_COMMIT_REF_NAME" != "master" ]; then
codecovcli -v create-commit -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --pr ${CI_COMMIT_REF_NAME} --git-service github;
codecovcli -v create-report -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --pr ${CI_COMMIT_REF_NAME} --git-service github;
else
codecovcli -v create-commit -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --git-service github;
codecovcli -v create-report -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --git-service github;
fi
#
#
#
codecov-finish:
stage: test
extends:
- .kubernetes-env
- .common-refs
- .pipeline-stopper-artifacts
needs:
- test-linux-stable-codecov
script:
- !reference [.codecov-check, script]
- codecovcli -v create-report-results -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --git-service github
- codecovcli -v get-report-results -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --git-service github
- codecovcli -v send-notifications -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --git-service github

#
#
#
test-linux-stable-codecov:
stage: test
needs:
- codecov-start
extends:
- .docker-env
- .common-refs
- .pipeline-stopper-artifacts
variables:
CI_IMAGE: europe-docker.pkg.dev/parity-build/ci-images/ci-unified:bullseye-1.77.0
RUST_TOOLCHAIN: stable
RUSTFLAGS: "-Cdebug-assertions=y -Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/cargo-test-${CI_NODE_INDEX}-%p-%m.profraw"
CARGO_INCREMENTAL: 0
FORKLIFT_BYPASS: "true"
parallel: 2
script:
# tools
- !reference [.codecov-check, script]
- rustup component add llvm-tools-preview
- mkdir -p target/coverage/result/
# Place real test call here
- >
time cargo nextest run -p polkadot \
--locked \
--release \
--no-fail-fast \
--partition count:${CI_NODE_INDEX}/${CI_NODE_TOTAL}
# generate and upload reports
- >
grcov \
target/coverage/ \
--binary-path ./target/release/ \
-s . \
-t lcov \
--branch \
-o target/coverage/result/report-${CI_NODE_INDEX}.lcov
- ls -l target/coverage/result/
- >
if [ "$CI_COMMIT_REF_NAME" != "master" ]; then
codecovcli -v do-upload -f target/coverage/result/report-${CI_NODE_INDEX}.lcov --disable-search -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --pr ${CI_COMMIT_REF_NAME} --git-service github;
else
codecovcli -v do-upload -f target/coverage/result/report-${CI_NODE_INDEX}.lcov --disable-search -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --git-service github;
fi
#

test-linux-stable:
stage: test
extends:
Expand Down
Loading

0 comments on commit 5c3a7a0

Please sign in to comment.