upend/.gitlab-ci.yml

140 lines
2.5 KiB
YAML
Raw Normal View History

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
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
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
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
2022-01-28 16:47:50 +01:00
lint:frontend:
stage: lint
image: $NODE_IMAGE
script:
- node --version && npm --version
- make frontend_lint
rules:
- allow_failure: true
2022-01-30 16:52:23 +01:00
lint:frontend_lib:
stage: lint
image: $NODE_IMAGE
script:
- node --version && npm --version
- make frontend_lib_lint
rules:
- allow_failure: true
build:backend:
stage: build
image: $RUST_IMAGE
script:
- rustc --version && cargo --version
- make backend
artifacts:
paths:
- target/release/upend
expire_in: 1 day
only:
changes:
- migrations/**/*
- src/**/*
- Cargo.lock
- Makefile
build:frontend:
stage: build
image: $NODE_IMAGE
script:
- node --version && npm --version
- make frontend
artifacts:
paths:
- webui/dist
2021-12-06 14:36:15 +01:00
- tools/upend_js
expire_in: 1 day
only:
changes:
2022-01-12 23:16:43 +01:00
- webui/**/*
- Makefile
test:backend:
stage: test
image: $RUST_IMAGE
script:
- make backend_test
2021-06-19 12:47:52 +02:00
only:
changes:
- migrations/**/*
- src/**/*
- Cargo.lock
2021-06-19 12:47:52 +02:00
- Makefile
2020-09-28 18:43:55 +02: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
package:
stage: release
image: $RUST_IMAGE
2021-06-11 15:36:14 +02:00
before_script:
- 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
- ln -s $PWD/squashfs-root/AppRun /usr/local/bin/linuxdeploy-x86_64.AppImage
- cd -
2020-09-28 18:43:55 +02:00
script:
2022-10-23 15:54:53 +02:00
- make package
artifacts:
paths:
2021-06-11 15:36:14 +02:00
- ./*.AppImage
only:
- tags