2023-06-18 10:25:42 -04:00
|
|
|
image: "rust:slim"
|
2022-02-17 23:35:37 -05:00
|
|
|
|
2023-06-18 10:25:42 -04:00
|
|
|
variables:
|
|
|
|
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
- release
|
|
|
|
|
|
|
|
cargo-build:
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- cargo build
|
|
|
|
|
|
|
|
cargo-test:
|
|
|
|
stage: test
|
2022-02-17 23:35:37 -05:00
|
|
|
script:
|
2023-06-18 10:25:42 -04:00
|
|
|
- rustc --version && cargo --version
|
2022-02-17 23:35:37 -05:00
|
|
|
- cargo test --workspace --verbose
|
|
|
|
|
2023-06-18 10:25:42 -04:00
|
|
|
clippy-lint:
|
|
|
|
stage: test
|
2022-02-17 23:35:37 -05:00
|
|
|
before_script:
|
2023-06-18 10:25:42 -04:00
|
|
|
- rustup component add clippy
|
2022-02-17 23:35:37 -05:00
|
|
|
script:
|
2023-06-18 10:25:42 -04:00
|
|
|
- cargo clippy
|
|
|
|
|
|
|
|
|
|
|
|
release-artifacts:
|
|
|
|
stage: release
|
|
|
|
script:
|
|
|
|
- cargo build --release
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- target/release/bannana-pho
|
|
|
|
expire_in: 1 week
|
|
|
|
|
|
|
|
release-container:
|
|
|
|
image: quay.io/podman/stable
|
|
|
|
stage: release
|
|
|
|
before_script:
|
|
|
|
- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
|
|
|
script:
|
2023-06-18 10:28:36 -04:00
|
|
|
- podman build -t $IMAGE_TAG -f ./Dockerfile
|
2023-06-18 10:25:42 -04:00
|
|
|
- podman push $IMAGE_TAG
|