pastebin/.gitlab-ci.yml

76 lines
1.4 KiB
YAML
Raw Normal View History

2020-01-06 17:35:03 +00:00
include:
- template: Auto-DevOps.gitlab-ci.yml
variables:
DAST_DISABLED: 'true'
2019-11-19 13:23:09 +00:00
build:webpack:
stage: build
2020-02-07 02:36:17 +00:00
image: node:12.15
2019-11-19 13:23:09 +00:00
script:
- npm ci
- node_modules/.bin/webpack
artifacts:
paths:
- static
- entry
build:release: &build
stage: test
2019-09-20 08:20:56 +00:00
image: rust:latest
2019-08-05 20:30:29 +00:00
script:
2019-11-19 13:23:09 +00:00
- &init rustc --version && cargo --version
2019-08-05 20:30:29 +00:00
- cargo build --release --verbose
2019-12-21 17:13:43 +00:00
- &clean_cargo cargo install cargo-cache --git https://github.com/matthiaskrgr/cargo-cache --no-default-features --features ci-autoclean && cargo-cache
2020-01-06 18:58:29 +00:00
needs:
- build:webpack
2019-08-05 20:30:29 +00:00
artifacts:
paths:
2019-11-22 20:37:27 +00:00
- languages.json
2019-09-20 17:54:27 +00:00
- migrations
- static
2019-11-22 20:37:27 +00:00
- target/release/pastebinrun
2019-09-20 09:13:29 +00:00
cache:
key: release
paths:
2019-11-19 13:23:09 +00:00
- target
2019-08-09 08:00:40 +00:00
2019-09-20 08:20:56 +00:00
test:stable: &test
2019-11-19 13:23:09 +00:00
stage: test
2019-08-09 09:45:34 +00:00
services:
- postgres
2019-12-31 12:54:55 +00:00
- name: registry.gitlab.com/pastebinrun/sandbox/master
2019-12-22 22:00:56 +00:00
alias: sandbox
2019-08-09 09:45:34 +00:00
variables:
POSTGRES_DB: db
POSTGRES_USER: user
POSTGRES_PASSWORD: password
2019-09-20 08:20:56 +00:00
image: rust:latest
2019-08-09 09:45:34 +00:00
script:
2019-11-19 12:50:42 +00:00
- *init
2019-12-22 22:00:56 +00:00
- DATABASE_URL=postgresql://user:password@postgres/db SANDBOX_URL=http://sandbox:8888 cargo test --verbose --features=database_tests,sandbox_tests
2019-12-21 17:13:43 +00:00
- *clean_cargo
2020-01-06 18:58:29 +00:00
needs:
- build:webpack
2019-09-20 09:13:29 +00:00
cache:
2019-11-19 13:23:09 +00:00
key: ${CI_JOB_NAME}
2019-09-20 09:13:29 +00:00
paths:
- target/
2019-11-19 13:23:09 +00:00
2020-01-17 11:43:00 +00:00
test:clippy:
<<: *test
script:
- *init
- rustup component add clippy
- cargo clippy --verbose
- *clean_cargo
2019-11-19 13:23:09 +00:00
test:1.39:
<<: *test
image: rust:1.39
test:nightly:
<<: *test
image: rustlang/rust:nightly
2020-01-06 18:40:22 +00:00
allow_failure: yes