2021-02-20 12:26:51 +01:00
|
|
|
variables:
|
|
|
|
RUST_IMAGE: "rust:latest"
|
|
|
|
NODE_IMAGE: "node:lts"
|
2021-03-15 22:43:14 +01:00
|
|
|
CARGO_HOME: $CI_PROJECT_DIR/cargo
|
2020-09-28 18:43:55 +02:00
|
|
|
|
2021-02-20 12:26:51 +01:00
|
|
|
stages:
|
|
|
|
- lint
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
- release
|
2020-09-28 18:43:55 +02:00
|
|
|
|
2021-03-15 22:43:14 +01:00
|
|
|
cache:
|
|
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
|
|
paths:
|
|
|
|
- target
|
|
|
|
- cargo
|
2022-01-12 23:16:43 +01:00
|
|
|
- webui/node_modules
|
2021-03-15 22:43:14 +01:00
|
|
|
|
2021-02-20 12:26:51 +01:00
|
|
|
lint:backend:
|
|
|
|
stage: lint
|
|
|
|
image: $RUST_IMAGE
|
|
|
|
script:
|
|
|
|
- rustup component add clippy
|
|
|
|
- make backend_lint
|
|
|
|
rules:
|
2021-06-19 12:50:33 +02:00
|
|
|
- changes:
|
2021-12-02 22:37:51 +01:00
|
|
|
- migrations/**/*
|
|
|
|
- src/**/*
|
|
|
|
- Cargo.lock
|
|
|
|
- Makefile
|
2021-06-19 12:53:27 +02:00
|
|
|
allow_failure: true
|
2021-02-20 12:26:51 +01:00
|
|
|
|
2022-01-28 14:29:43 +01:00
|
|
|
lint:backend_no_default_features:
|
|
|
|
stage: lint
|
|
|
|
image: $RUST_IMAGE
|
|
|
|
script:
|
|
|
|
- rustup component add clippy
|
|
|
|
- make backend_lint_no_default
|
|
|
|
rules:
|
|
|
|
- changes:
|
|
|
|
- migrations/**/*
|
|
|
|
- src/**/*
|
|
|
|
- Cargo.lock
|
|
|
|
- Makefile
|
|
|
|
allow_failure: true
|
|
|
|
|
2021-02-20 12:26:51 +01:00
|
|
|
#lint:frontend:
|
|
|
|
# stage: lint
|
|
|
|
# image: $NODE_IMAGE
|
|
|
|
# script:
|
|
|
|
# - make frontend_lint
|
|
|
|
# rules:
|
|
|
|
# - allow_failure: true
|
|
|
|
|
|
|
|
build:backend:
|
|
|
|
stage: build
|
|
|
|
image: $RUST_IMAGE
|
|
|
|
script:
|
|
|
|
- rustc --version && cargo --version
|
|
|
|
- make backend
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2021-06-19 10:45:05 +02:00
|
|
|
- target/release/upend
|
2021-02-20 12:26:51 +01:00
|
|
|
expire_in: 1 day
|
2021-06-19 12:46:45 +02:00
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- migrations/**/*
|
|
|
|
- src/**/*
|
2021-06-20 14:42:41 +02:00
|
|
|
- Cargo.lock
|
2021-06-19 12:46:45 +02:00
|
|
|
- Makefile
|
2021-02-20 12:26:51 +01:00
|
|
|
|
|
|
|
build:frontend:
|
|
|
|
stage: build
|
|
|
|
image: $NODE_IMAGE
|
|
|
|
script:
|
|
|
|
- node --version && npm --version
|
|
|
|
- make frontend
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2022-01-12 23:16:43 +01:00
|
|
|
- webui/public
|
2021-12-06 14:36:15 +01:00
|
|
|
- tools/upend_js
|
2021-02-20 12:26:51 +01:00
|
|
|
expire_in: 1 day
|
2021-06-19 12:46:45 +02:00
|
|
|
only:
|
|
|
|
changes:
|
2022-01-12 23:16:43 +01:00
|
|
|
- webui/**/*
|
2021-06-19 12:46:45 +02:00
|
|
|
- Makefile
|
2021-02-20 12:26:51 +01:00
|
|
|
|
|
|
|
test:backend:
|
|
|
|
stage: test
|
|
|
|
image: $RUST_IMAGE
|
|
|
|
script:
|
|
|
|
- make backend_test
|
2021-06-19 12:47:52 +02:00
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- migrations/**/*
|
|
|
|
- src/**/*
|
2021-06-20 14:42:41 +02:00
|
|
|
- Cargo.lock
|
2021-06-19 12:47:52 +02:00
|
|
|
- Makefile
|
2020-09-28 18:43:55 +02:00
|
|
|
|
2021-12-27 13:23:23 +01:00
|
|
|
test:backend_no_default_features:
|
|
|
|
stage: test
|
|
|
|
image: $RUST_IMAGE
|
|
|
|
script:
|
|
|
|
- make backend_test_no_default
|
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- migrations/**/*
|
|
|
|
- src/**/*
|
|
|
|
- Cargo.lock
|
|
|
|
- Makefile
|
|
|
|
allow_failure: true # remove at v1.0
|
|
|
|
|
2021-02-20 12:26:51 +01:00
|
|
|
package:
|
|
|
|
stage: release
|
2021-06-20 16:32:13 +02:00
|
|
|
image: $RUST_IMAGE
|
2021-06-11 15:36:14 +02:00
|
|
|
before_script:
|
2021-06-11 16:27:13 +02:00
|
|
|
- cd /tmp
|
|
|
|
- wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
|
|
|
- chmod +x linuxdeploy-x86_64.AppImage
|
|
|
|
- ./linuxdeploy-x86_64.AppImage --appimage-extract
|
2021-06-11 17:12:50 +02:00
|
|
|
- ln -s $PWD/squashfs-root/AppRun /usr/local/bin/linuxdeploy-x86_64.AppImage
|
2021-06-11 16:48:16 +02:00
|
|
|
- cd -
|
2020-09-28 18:43:55 +02:00
|
|
|
script:
|
2021-02-20 12:26:51 +01:00
|
|
|
- make
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2021-06-11 15:36:14 +02:00
|
|
|
- ./*.AppImage
|
2021-06-19 12:46:45 +02:00
|
|
|
only:
|
|
|
|
- tags
|