mirror of
https://github.com/bahdotsh/wrkflw.git
synced 2026-05-18 05:05:35 +02:00
- Move test workflows to tests/workflows/ - Move GitLab CI fixtures to tests/fixtures/gitlab-ci/ - Move test scripts to tests/scripts/ - Move Podman testing docs to tests/ - Update paths in test scripts and documentation - Delete MANUAL_TEST_CHECKLIST.md as requested - Update tests/README.md to reflect new organization
63 lines
1.4 KiB
YAML
63 lines
1.4 KiB
YAML
.test-template:
|
|
stage: test
|
|
dependencies:
|
|
- build
|
|
cache:
|
|
key:
|
|
files:
|
|
- Cargo.lock
|
|
paths:
|
|
- ${CARGO_HOME}
|
|
- target/
|
|
|
|
# Unit tests
|
|
unit-tests:
|
|
extends: .test-template
|
|
script:
|
|
- cargo test --lib
|
|
rules:
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
- if: $CI_COMMIT_BRANCH == "main"
|
|
|
|
# Integration tests
|
|
integration-tests:
|
|
extends: .test-template
|
|
script:
|
|
- cargo test --test '*'
|
|
rules:
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
- if: $CI_COMMIT_BRANCH == "main"
|
|
|
|
# Lint with clippy
|
|
lint:
|
|
extends: .test-template
|
|
dependencies: [] # No dependencies needed for linting
|
|
script:
|
|
- rustup component add clippy
|
|
- cargo clippy -- -D warnings
|
|
rules:
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
- if: $CI_COMMIT_BRANCH == "main"
|
|
|
|
# Check formatting
|
|
format:
|
|
extends: .test-template
|
|
dependencies: [] # No dependencies needed for formatting
|
|
script:
|
|
- rustup component add rustfmt
|
|
- cargo fmt -- --check
|
|
rules:
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
- if: $CI_COMMIT_BRANCH == "main"
|
|
|
|
# Deployment template
|
|
.deploy-template:
|
|
stage: deploy
|
|
script:
|
|
- echo "Deploying to ${ENVIRONMENT} environment"
|
|
- cp target/release/wrkflw /tmp/wrkflw-${ENVIRONMENT}
|
|
artifacts:
|
|
paths:
|
|
- /tmp/wrkflw-${ENVIRONMENT}
|
|
dependencies:
|
|
- build |