variables: RUST_IMAGE: "rust:latest" NODE_IMAGE: "node:lts" CARGO_HOME: $CI_PROJECT_DIR/cargo stages: - lint - build - test - release cache: key: ${CI_COMMIT_REF_SLUG} paths: - target - cargo - ui/node_modules lint:backend: stage: lint image: $RUST_IMAGE script: - rustup component add clippy - make backend_lint rules: - changes: - migrations/**/* - src/**/* - Cargo.lock - Makefile allow_failure: true #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: - 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: - ui/dist expire_in: 1 day only: changes: - ui/**/* - Makefile test:backend: stage: test image: $RUST_IMAGE script: - make backend_test only: changes: - migrations/**/* - src/**/* - Cargo.lock - Makefile package: stage: release image: $RUST_IMAGE 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 - script: - make artifacts: paths: - ./*.AppImage only: - tags