pastebin/.gitlab-ci.yml
2020-02-07 02:36:17 +00:00

76 lines
1.4 KiB
YAML

include:
- template: Auto-DevOps.gitlab-ci.yml
variables:
DAST_DISABLED: 'true'
build:webpack:
stage: build
image: node:12.15
script:
- npm ci
- node_modules/.bin/webpack
artifacts:
paths:
- static
- entry
build:release: &build
stage: test
image: rust:latest
script:
- &init rustc --version && cargo --version
- cargo build --release --verbose
- &clean_cargo cargo install cargo-cache --git https://github.com/matthiaskrgr/cargo-cache --no-default-features --features ci-autoclean && cargo-cache
needs:
- build:webpack
artifacts:
paths:
- languages.json
- migrations
- static
- target/release/pastebinrun
cache:
key: release
paths:
- target
test:stable: &test
stage: test
services:
- postgres
- name: registry.gitlab.com/pastebinrun/sandbox/master
alias: sandbox
variables:
POSTGRES_DB: db
POSTGRES_USER: user
POSTGRES_PASSWORD: password
image: rust:latest
script:
- *init
- DATABASE_URL=postgresql://user:password@postgres/db SANDBOX_URL=http://sandbox:8888 cargo test --verbose --features=database_tests,sandbox_tests
- *clean_cargo
needs:
- build:webpack
cache:
key: ${CI_JOB_NAME}
paths:
- target/
test:clippy:
<<: *test
script:
- *init
- rustup component add clippy
- cargo clippy --verbose
- *clean_cargo
test:1.39:
<<: *test
image: rust:1.39
test:nightly:
<<: *test
image: rustlang/rust:nightly
allow_failure: yes