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.34-stretch" unified_test: variables: POSTGRES_DB: "fatcat_test" POSTGRES_USER: "fatcat_user" POSTGRES_PASSWORD: "fatcat_pw" DATABASE_URL: "postgres://fatcat_user:fatcat_pw@postgres/fatcat_test" TEST_DATABASE_URL: "postgres://fatcat_user:fatcat_pw@postgres/fatcat_test" services: - "postgres:11" 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 - cargo install diesel_cli --version 1.3.1 - pip3 install pipenv - pipenv --version script: - rustc --version && cargo --version && diesel --version - cd rust - cp example.env .env - diesel database reset && diesel migration run - cargo build - cargo test -- --test-threads 1 - cargo run --bin fatcatd & - cd ../python_client - pytest-3 - cd ../python - cp example.env .env - pipenv install --dev --deploy - pipenv run pytest --cov - pipenv run ./tests/cli.sh # Just errors - pipenv run pylint -E fatcat*.py fatcat_tools fatcat_web tests/*.py rust_build_release: 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 - ./build_tarball.sh artifacts: paths: - 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