diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1946771..49dbb9f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,11 +18,14 @@ stages: - cache-cleanup - build-base - build - - version - test # TEMPLATES +# this step uses cargo-sweep to clean up unneeded cruft that accumulates over time in the target dir. cargo clean is +# not used because it simply rm -rf's the entire target directory (and thus prevents build caching). i would really like +# to either replace this with a bash script, or to install cargo-sweep as a binary instead of building it from source +# like this. i'd also like to add a step that checks to see whether the target dir exists, and exits early if not. .cargo-cleanup: stage: cache-cleanup allow_failure: true @@ -30,11 +33,15 @@ stages: - cargo install cargo-sweep - cargo sweep -i +# this builds a "base" version of fif with default features enabled. this is done separately from the main build step +# for the purposes of caching - by building once *before* executing the parallel cargo-build step, we ensure that +# cargo-build can reuse some cached stuff, rather than building from scratch every time. .cargo-build-base: stage: build-base script: cargo build --locked +# build with various features on and off. .cargo-build: extends: .cargo-build-base stage: build @@ -49,6 +56,7 @@ stages: script: cargo build --no-default-features --locked --features="json $FEATURES" +# test with various features on and off. .cargo-test: extends: .cargo-build stage: test @@ -57,6 +65,9 @@ stages: # LINT +# run the included clippy.sh with "ci" mode on - clippy will exit with code 1 if anything at all is amiss. this is just +# here to make sure i remember to run clippy.sh locally myself and fix/ignore all the warnings before committing, as i +# should be. clippy: stage: lint script: @@ -137,14 +148,6 @@ build-nightly: - target - .cargo -# VERSION - -fif-version: - stage: version - needs: ["build-stable"] - script: - cargo run -- -V - # TEST test-stable: