summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2021-02-08 18:51:25 +0100
committerAzul <azul@riseup.net>2021-02-08 18:56:38 +0100
commit862077e0700bbdeae356d13770ae21546a9f8508 (patch)
treec2086a51c33836d106203e5ea50fc8f32532169c
parentb0679185160304f20c91e719dd4c8499536c2daf (diff)
ci: test caching mechanismazul/test-ci-cache
-rw-r--r--.gitlab-ci.yml168
1 files changed, 13 insertions, 155 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9156c0b9..146a37a7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,155 +1,13 @@
-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
- - if [ -d $CARGO_HOME ]; then find $CARGO_HOME | wc --lines; du -sh $CARGO_HOME; fi
- - rustc --version
- - cargo --version
- - clang --version
-
-after_script:
- - find $CARGO_TARGET_DIR -type f -atime +7 -delete
- - du -sh $CARGO_TARGET_DIR
- - du -sh $CARGO_HOME
-
-bullseye:
- tags:
- - linux
- stage: build
- image: registry.gitlab.com/sequoia-pgp/build-docker-image/bullseye:latest
- dependencies:
- - codespell
-
- script:
- - SEQUOIA_CTEST_VALGRIND=/usr/bin/valgrind cargo test -p sequoia-openpgp-ffi
- - cargo test --all --exclude sequoia-openpgp-ffi
- - make
- - if ! git diff --quiet Cargo.lock ; then echo "Cargo.lock changed. Please add the change to the corresponding commit." ; false ; fi
- - make -C sq update-usage
- - if ! git diff --quiet sq ; then echo "Please run 'make -C sq update-usage' and commit the result." ; false ; fi
- - make -C sqv update-usage
- - if ! git diff --quiet sqv ; then echo "Please run 'make -C sqv update-usage' and commit the result." ; false ; fi
- - if ! git diff --quiet ; then echo "The build changed the source. Please investigate." ; git diff ; fi
-
- variables:
- 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"]
- except:
- # Do not run for pushes to the pep-engine branch.
- - /^pep-engine$/
-
- 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
- stage: pre-check
- image: registry.gitlab.com/sequoia-pgp/build-docker-image/bullseye:latest
-
- before_script:
- - codespell --version
- script:
- - make codespell CODESPELL_FLAGS=--summary
- after_script: []
-
-rust-stable:
- tags:
- - linux
- stage: build
- image: rust:1-slim-buster
-
- 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
- - 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:
- - cargo test -p buffered-reader -p sequoia-openpgp -p sequoia-sqv
-
- variables:
- CARGO_TARGET_DIR: $CI_PROJECT_DIR/../target.$CI_CONCURRENT_ID.rust-stable
- RUSTFLAGS: -D warnings -A unused-parens
-
-windows-gnu:
- tags:
- - win
- - win2019
- stage: build
- image: registry.gitlab.com/sequoia-pgp/build-docker-image/windows-gnu
- # This job takes ~20 minutes to run, let's only execute it manually or for
- # scheduled builds, otherwise this will stall MRs often not related to Windows
- only:
- - /windows/i # refs containing 'windows' keyword
- - tags
- - web
- - scheduled
- before_script:
- - clang -v
- - rustc --version --verbose
- - cargo --version
- script:
- - cargo test --all --exclude sequoia-openpgp-ffi
- # https://github.com/rust-lang/cargo/issues/5015
- - cargo test --manifest-path openpgp/Cargo.toml --no-default-features --features crypto-cng,compression
- after_script: []
- variables:
- CFLAGS: "" # Silence some C warnings when compiling under Windows
-
-windows-msvc:
- tags:
- - win
- - win2019
- stage: build
- image: registry.gitlab.com/sequoia-pgp/build-docker-image/windows-msvc
- before_script:
- - rustc --version --verbose
- - cargo --version
- script:
- # https://github.com/rust-lang/cargo/issues/5015
- - cargo build --manifest-path ffi/Cargo.toml --no-default-features --features crypto-cng,compression
- - cargo build --manifest-path openpgp-ffi/Cargo.toml --no-default-features --features crypto-cng,compression
- - cargo test --manifest-path openpgp/Cargo.toml --no-default-features --features crypto-cng,compression
- after_script: []
- variables:
- CFLAGS: "" # Silence some C warnings when compiling with MSVC
-
-variables:
- DEBIAN_FRONTEND: noninteractive
- CARGO_HOME: $CI_PROJECT_DIR/../cargo
- CARGO_FLAGS: --color always
- CARGO_INCREMENTAL: 0
- RUST_BACKTRACE: full
- RUSTFLAGS: -D warnings
- CFLAGS: -Werror
- QUICKCHECK_GENERATOR_SIZE: 500 # https://github.com/BurntSushi/quickcheck/pull/240
+test-caching:
+ image: rust:latest
+ before_script:
+ - mkdir -p cache_me
+ - ls -lah cache_me
+ script:
+ - touch cache_me/exhibit_a
+ after_script:
+ - ls -lah cache_me
+ cache:
+ paths:
+ - cache_me
+ key: i_m_just_here_to_test_the_cache