Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
9eeba398
Unverified
Commit
9eeba398
authored
1 year ago
by
bgallois
Browse files
Options
Downloads
Patches
Plain Diff
ci: add benchmark tests
parent
b7d0b525
No related branches found
No related tags found
No related merge requests found
Pipeline
#34017
failed
1 year ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+15
-0
15 additions, 0 deletions
.gitlab-ci.yml
docker/Dockerfile
+12
-2
12 additions, 2 deletions
docker/Dockerfile
with
27 additions
and
2 deletions
.gitlab-ci.yml
+
15
−
0
View file @
9eeba398
...
...
@@ -116,6 +116,21 @@ build_release:
IMAGE_TAG
:
"
sha-$CI_COMMIT_SHORT_SHA"
PODMAN_BUILD_OPTIONS
:
"
--platform
linux/amd64"
run_benchmarks
:
stage
:
tests
extends
:
.docker_build
rules
:
-
if
:
$CI_COMMIT_REF_NAME =~ /^wip*$/
when
:
manual
-
if
:
$CI_COMMIT_TAG
when
:
never
-
if
:
'
$CI_MERGE_REQUEST_ID
||
$CI_COMMIT_BRANCH
==
"master"'
-
when
:
manual
variables
:
IMAGE_NAME
:
"
duniter/duniter-v2s-test"
IMAGE_TAG
:
"
debug-sha-$CI_COMMIT_SHORT_SHA"
PODMAN_BUILD_OPTIONS
:
"
--target
build
--build-arg
--build-arg
benchmarks=1"
test_debug
:
stage
:
tests
extends
:
.docker_build
...
...
This diff is collapsed.
Click to expand it.
docker/Dockerfile
+
12
−
2
View file @
9eeba398
...
...
@@ -33,6 +33,11 @@ RUN if [ "$debug" = 0 ]; then \
echo
"TARGET_FOLDER=debug"
>>
/root/dynenv
;
\
fi
ARG
benchmarks=0
RUN if
[
"
$benchmarks
"
!=
0
]
;
then
\
echo
"BENCH_OPTIONS=--features runtime-benchmarks"
>>
/root/dynenv
;
\
fi
# Configure cross-build environment if need be
RUN
set
-x
&&
\
if
[
"
$TARGETPLATFORM
"
!=
"
$BUILDPLATFORM
"
]
;
then
\
...
...
@@ -47,14 +52,14 @@ RUN set -x && \
RUN
set
-x
&&
\
cat
/root/dynenv
&&
\
.
/root/dynenv
&&
\
cargo build
--locked
$CARGO_OPTIONS
--target
"
$RUST_ARCH_TRIPLET
"
&&
\
cargo build
--locked
$CARGO_OPTIONS
$BENCH_OPTIONS
--target
"
$RUST_ARCH_TRIPLET
"
&&
\
mkdir
-p
build
&&
\
mv
target/
$RUST_ARCH_TRIPLET
/
$TARGET_FOLDER
/duniter build/
# Run tests if requested, expted when cross-building
ARG
cucumber=0
RUN if
[
"
$cucumber
"
!=
0
]
&&
[
"
$TARGETPLATFORM
"
=
"
$BUILDPLATFORM
"
]
;
then
\
cargo
test
--workspace
--exclude
duniter-end2end-tests
--exclude
duniter-live-tests
&&
\
cargo
test
--workspace
--exclude
duniter-end2end-tests
--exclude
duniter-live-tests
--features
runtime-benchmarks
&&
\
cargo cucumber
-i
account_creation
*
&&
\
cargo cucumber
-i
certification
*
&&
\
cargo cucumber
-i
identity_creation
*
&&
\
...
...
@@ -66,6 +71,11 @@ RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \
mv
cucumber_tests
*
../../../build/duniter-cucumber
;
\
fi
# Run runtime benchmarks
RUN if
[
"
$benchmarks
"
!=
0
]
;
then
\
build/duniter benchmark pallet
--chain
dev
--execution
=
wasm
--wasm-execution
=
compiled
--pallet
"*"
--extrinsic
"*"
--steps
2
--repeat
1
fi
# ------------------------------------------------------------------------------
# Final Stage
# ------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment