Rust (With Cargo)
Example Rust (With Cargo) Pipeline
Example Yaml configuration for a project building a Rust binary with Cargo.
Scenario
User is looking to create a pipeline that builds an artifact on any event or branch pushed to source control.
Steps
The following pipeline concepts are being used in the pipeline below:
Note:
Pipeline must be stored in base of repository as .vela.yml
or .vela.yaml
It is recommended to pin image:
versions for production pipelines
version: "1"
steps:
- name: fetch
image: rust:latest
pull: always
commands:
- cargo fetch --verbose --all
- name: test
image: rust:latest
pull: always
environment:
CGO_ENABLED: '0'
GOOS: linux
commands:
- cargo test --verbose --all
- name: build
image: rust:latest
pull: always
environment:
CGO_ENABLED: '0'
GOOS: linux
commands:
- cargo build --verbose --all
Stages
The following pipeline concepts are being used in the pipeline below:
Note:
Pipeline must be stored in base of repository as .vela.yml
or .vela.yaml
It is recommended to pin image:
versions for production pipelines
version: "1"
stages:
fetch:
steps:
- name: fetch
image: rust:latest
pull: always
commands:
- cargo fetch --verbose --all
test:
needs: [ fetch ]
steps:
- name: test
image: rust:latest
pull: always
commands:
- cargo test --verbose --all
build:
needs: [ fetch ]
steps:
- name: build
image: rust:latest
pull: always
commands:
- cargo build --verbose --all
Last modified June 3, 2021: refactor: replace concepts with tour (#207) (aa0aceac)