aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
blob: d404b33250a28102354fdcb0b0168d969c1435db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

unified_test:
  image: "rust:1.31-stretch"
  variables:
    LC_ALL: "C.UTF-8"
    LANG: "C.UTF-8"
    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:
    - cargo install diesel_cli --version 1.3.1
    - 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
    - pipenv --version
  script:
    - rustc --version && cargo --version && diesel --version
    - cd rust
    - cp env.example .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 env.example .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

rust_build_release:
  only:
    - tags  # doesn't build for most commits; only tagged
  image: "rust:1.26-stretch"
  script:
    - rustc --version && cargo --version
    - cd rust
    - cargo build --release
    - cargo doc
  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
    expire_in: 1 year