diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2020-09-28 15:28:42 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2020-10-09 16:17:31 +0200 |
commit | f8ed2674debf91bc6ae2365fdd68639eb909b802 (patch) | |
tree | f14a19f5077ffc188e8a12b7562f1d87f1c2475d | |
parent | 7a4090a30dcab63f41ff40535bccf456382129bd (diff) |
ci: Run openpgp tests for each commit.
- Add a job to test all commits up to master.
- Use `git rebase --exec` to run tests for each commit.
- Set dummy credentials to make git rebase happy.
- Use `git clone` strategy to limit impact on other jobs.
-rw-r--r-- | .gitlab-ci.yml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 440f6446..cbd56707 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - pre-check - build + - test before_script: - if [ -d $CARGO_TARGET_DIR ]; then find $CARGO_TARGET_DIR | wc --lines; du -sh $CARGO_TARGET_DIR; fi @@ -37,6 +38,32 @@ bullseye: CARGO_TARGET_DIR: $CI_PROJECT_DIR/../target.$CI_CONCURRENT_ID.bullseye RUSTFLAGS: -D warnings -A unused-parens +all_commits: + # Test each commit up to master, to facilitate bisecting. + stage: test + image: rust:1-slim-buster + needs: ["rust-stable"] + + before_script: + - apt update -y -qq + - apt install --no-install-recommends -y -qq -o=Dpkg::Use-Pty=0 clang libclang-dev llvm pkg-config nettle-dev git + - if [ -d $CARGO_TARGET_DIR ]; then find $CARGO_TARGET_DIR | wc --lines; du -sh $CARGO_TARGET_DIR; fi + - if [ -d $CARGO_HOME ]; then find $CARGO_HOME | wc --lines; du -sh $CARGO_HOME; fi + - rustc --version + - cargo --version + - clang --version + + script: + # Use dummy identity to make git rebase happy. + - git config user.name "C.I. McTestface" + - git config user.email "ci.mctestface@example.com" + - if ! git rebase --exec "echo ===; echo ===; echo ===; git log -n 1; cargo test -p sequoia-openpgp" origin/master; then git rebase --abort; false; fi + + variables: + CARGO_TARGET_DIR: $CI_PROJECT_DIR/../target.$CI_CONCURRENT_ID.all_commits + RUSTFLAGS: -D warnings -A unused-parens + GIT_STRATEGY: clone + codespell: tags: - linux |