Skip to content

Commit

Permalink
Tweak caching and upload docs to gitlab pages
Browse files Browse the repository at this point in the history
  • Loading branch information
nmccarty committed Jul 13, 2021
1 parent 28ac379 commit e8a565d
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ stages:
- check
- build
- test
- doc

variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo
CARGO_HOME: $CI_PROJECT_DIR/.cargo-home

# Override git urls to use ci-job-token
before_script:
Expand All @@ -23,9 +24,9 @@ lint:fmt:
script:
- cargo fmt -- --check
cache:
key: fmt-cache
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .cargo/
- .cargo-home/
- target/

lint:clippy:
Expand All @@ -35,9 +36,9 @@ lint:clippy:
script:
- cargo clippy -- -D warnings
cache:
key: clippy-cache
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .cargo/
- .cargo-home/
- target/
allow_failure: true

Expand All @@ -48,9 +49,9 @@ lint:audit:
script:
- cargo audit
cache:
key: audit-cache
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .cargo/
- .cargo-home/
- target/
allow_failure: true

Expand All @@ -61,9 +62,9 @@ check:
script:
- cargo check
cache:
key: check-cache
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .cargo/
- .cargo-home/
- target/

build:
Expand All @@ -79,7 +80,7 @@ build:
cache:
key: build-cache
paths:
- .cargo/
- .cargo-home/
- target/

test:cargo:
Expand All @@ -90,9 +91,9 @@ test:cargo:
- cargo test --release --all-features
dependencies: []
cache:
key: test-cache
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .cargo/
- .cargo-home/
- target/

test:dentry-simulator:
Expand All @@ -104,3 +105,24 @@ test:dentry-simulator:
dependencies:
- build

pages:
stage: doc
tags:
- docker
script:
- cargo doc --no-deps --document-private-items -p phaselock -p threshold_crypto
- cp -R target/doc public
- echo '<meta http-equiv="refresh" content="0; url=phaselock">' > public/index.html
artifacts:
paths:
- public
dependencies: []
needs: []
only:
- main
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .cargo-home/
- target/

0 comments on commit e8a565d

Please sign in to comment.