diff options
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4dc25d1a..6a2be733 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,21 @@ +cache: + key: "${CI_COMMIT_REF_SLUG}" + paths: + - python/.venv/ + - rust/target/ + - rust/.cargo_cache/ + +variables: + LC_ALL: "C.UTF-8" + LANG: "C.UTF-8" + PIPENV_VENV_IN_PROJECT: "true" + CARGO_HOME: ".cargo_cache" + +image: "rust:1.32-stretch" + unified_test: - image: "rust:1.32-stretch" variables: - LC_ALL: "C.UTF-8" - LANG: "C.UTF-8" POSTGRES_DB: "fatcat_test" POSTGRES_USER: "fatcat_user" POSTGRES_PASSWORD: "fatcat_pw" @@ -12,9 +24,10 @@ unified_test: services: - "postgres:11" before_script: - - cargo install diesel_cli --version 1.3.1 + - export PATH="$PATH:$CARGO_HOME/bin" - apt update -qy - apt install -y python3-dev python3-pip python3-wheel python3-requests python3-six python3-pytest libsnappy-dev libsodium-dev + - cargo install diesel_cli --version 1.3.1 - pip3 install pipenv - pipenv --version script: @@ -36,27 +49,34 @@ unified_test: - pipenv run pylint -E fatcat*.py fatcat_tools fatcat_web tests/*.py rust_build_release: - only: - - tags # doesn't build for most commits; only tagged - image: "rust:1.32-stretch" - variables: - LC_ALL: "C.UTF-8" - LANG: "C.UTF-8" + stage: build + when: manual before_script: + - export PATH="$PATH:$CARGO_HOME/bin" - apt update -qy - apt install -y python3-dev python3-pip python3-wheel python3-requests python3-six python3-pytest libsnappy-dev libsodium-dev script: - rustc --version && cargo --version - cd rust - - cargo build --release - - cargo doc + - ./build_tarball.sh artifacts: paths: - - rust/target/release/fatcat* - - rust/target/doc/fatcat* - - rust/target/doc/*.css - - rust/target/doc/*.js - - rust/target/doc/*.woff - - rust/target/doc/*.svg + - rust/fatcat-rust.tar.gz expire_in: 1 year +python_build_release: + stage: build + when: manual + before_script: + - apt update -qy + - apt install -y python3-dev python3-pip python3-wheel python3-requests python3-six python3-pytest libsnappy-dev libsodium-dev + - pip3 install pipenv + script: + - python3 --version + - pipenv --version + - cd python + - ./build_tarball.sh + artifacts: + paths: + - python/fatcat-python.tar.gz + expire_in: 1 year |