Files
wrkflw/.gitlab-ci.yml
bahdotsh e73b0df520 feat(gitlab): add comprehensive GitLab CI/CD pipeline support
This commit adds full support for GitLab CI/CD pipelines:

- Add GitLab CI pipeline models with complete spec support (jobs, stages, artifacts, cache, etc.)
- Implement GitLab CI/CD pipeline parsing and validation
- Add schema validation against GitLab CI JSON schema
- Support automatic pipeline type detection based on filename and content
- Add GitLab-specific CLI commands and flags
- Implement pipeline conversion for executor compatibility
- Add validation for common GitLab CI configuration issues
- Update CLI help text to reflect GitLab CI/CD support
- Support listing both GitHub and GitLab pipeline files

This expands wrkflw to be a multi-CI tool that can validate and execute both GitHub
Actions workflows and GitLab CI/CD pipelines locally.
2025-05-02 15:08:59 +05:30

100 lines
1.8 KiB
YAML

# GitLab CI/CD Pipeline for wrkflw
# This pipeline will build and test the Rust project
stages:
- build
- test
- deploy
variables:
RUST_VERSION: "1.70.0"
CARGO_TERM_COLOR: always
# Cache settings
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- target/
script:
- echo "This is a placeholder - the cache directive doesn't need a script"
# Lint job - runs rustfmt and clippy
lint:
stage: test
image: rust:${RUST_VERSION}
script:
- rustup component add clippy
- cargo clippy -- -D warnings
allow_failure: true
# Build job - builds the application
build:
stage: build
image: rust:${RUST_VERSION}
script:
- cargo build --verbose
artifacts:
paths:
- target/debug
expire_in: 1 week
# Test job - runs unit and integration tests
test:
stage: test
image: rust:${RUST_VERSION}
script:
- cargo test --verbose
dependencies:
- build
# Release job - creates a release build
release:
stage: deploy
image: rust:${RUST_VERSION}
script:
- cargo build --release --verbose
artifacts:
paths:
- target/release/wrkflw
expire_in: 1 month
rules:
- if: $CI_PIPELINE_SOURCE == "web" && $BUILD_RELEASE == "true"
when: always
- if: $CI_COMMIT_TAG
when: always
- when: never
# Custom job for documentation
docs:
stage: deploy
image: rust:${RUST_VERSION}
script:
- cargo doc --no-deps
- mkdir -p public
- cp -r target/doc/* public/
artifacts:
paths:
- public
only:
- main
format:
stage: test
image: rust:${RUST_VERSION}
script:
- rustup component add rustfmt
- cargo fmt --check
allow_failure: true
pages:
stage: deploy
image: rust:${RUST_VERSION}
script:
- cargo doc --no-deps
- mkdir -p public
- cp -r target/doc/* public/
artifacts:
paths:
- public
only:
- main