All Projects → xoac → rust-azure-pipelines

xoac / rust-azure-pipelines

Licence: MIT License
Collection of azure pipelines templates for rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to rust-azure-pipelines

AzDo.VstsDashboard
Provide a simple way to view all Builds and Releases on a single page. The intend was to see what's currently happened into the CI/CD pipeline and provide quick feedback of what's going on.
Stars: ✭ 16 (-62.79%)
Mutual labels:  ci, cd
test-infra
Falco workflow & testing infrastructure
Stars: ✭ 18 (-58.14%)
Mutual labels:  ci, cd
action-junit-report
Reports junit test results as GitHub Pull Request Check
Stars: ✭ 103 (+139.53%)
Mutual labels:  ci, cd
symfony-lts-docker-starter
🐳 Dockerized your Symfony project using a complete stack (Makefile, Docker-Compose, CI, bunch of quality insurance tools, tests ...) with a base according to up-to-date components and best practices.
Stars: ✭ 39 (-9.3%)
Mutual labels:  ci, cd
flagsmith-nodejs-client
Flagsmith Node JS Client. Flagsmith lets you manage features flags across web, mobile and server side applications. Get builds out faster. Control who has access to new features.
Stars: ✭ 13 (-69.77%)
Mutual labels:  ci, cd
devops-guidebook
📚 DevOps 知识图谱 关于Linux、服务器、数据库、部署等相关体系
Stars: ✭ 25 (-41.86%)
Mutual labels:  ci, cd
dockerized-drupal-starter
End-to-end (CI + CD) dockerized Drupal 8 starting point.
Stars: ✭ 27 (-37.21%)
Mutual labels:  ci, cd
springboot-deploy-demo
spring boot deploy
Stars: ✭ 16 (-62.79%)
Mutual labels:  ci, cd
update-container-description-action
github action to update a Docker Hub, Quay or Harbor repository description from a README file
Stars: ✭ 20 (-53.49%)
Mutual labels:  ci, cd
setup-scheme
Github Actions CI / CD setup for Scheme
Stars: ✭ 13 (-69.77%)
Mutual labels:  ci, cd
howtheydevops
A curated collection of publicly available resources on how companies around the world practice DevOps
Stars: ✭ 318 (+639.53%)
Mutual labels:  ci, cd
makes
A DevSecOps framework powered by Nix.
Stars: ✭ 158 (+267.44%)
Mutual labels:  ci, cd
wordpress-skeleton
A base repository structure for rtCamp's WordPress sites, pre-configured to use Github Actions
Stars: ✭ 32 (-25.58%)
Mutual labels:  ci, cd
xray-action
... a GitHub action to import test results into "Xray" - A complete Test Management tool for Jira.
Stars: ✭ 16 (-62.79%)
Mutual labels:  ci, cd
ci playground
Playground for Cloud CI development for C++
Stars: ✭ 23 (-46.51%)
Mutual labels:  ci, azure-pipelines
flagsmith-js-client
Javascript Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/
Stars: ✭ 42 (-2.33%)
Mutual labels:  ci, cd
quickstart-docker-git
Boostrap projects with a Dockerfile and a folder structure that works.
Stars: ✭ 47 (+9.3%)
Mutual labels:  ci, templates
docker-pega-web-ready
Docker project for generating a tomcat docker image for Pega
Stars: ✭ 46 (+6.98%)
Mutual labels:  ci, cd
docs
OOCLAB 开放文档中心
Stars: ✭ 14 (-67.44%)
Mutual labels:  ci, cd
changie
Automated changelog tool for preparing releases with lots of customization options
Stars: ✭ 180 (+318.6%)
Mutual labels:  ci, cd

master: Build Status

develop: Build Status

The idea

The idea of using this CI/CD is create common templates for rust users. It should be ready to work in 5min with good default values. It allow you:

  • check and tests:
    • on Windows, Linux, MacOs natively and with quemu for other targets
    • with any rust version you want (nightly, stable, 1.31 etc)
  • check formatting
  • use lints (cargo clippy)
  • deploys to github (documentation and binaries)

Copy past examples:

If you just started using azure pipelines you can copy paste into azure-pipelines.yml. Check and test should be good default one

Check and test

This is the default and should be sufficiently. How to create endpoint?

trigger:
  branches:
    include: ['*']
  tags:
    include: ['*']

resources:
  repositories:
    - repository: rust_pipelines
      type: github
      name: xoac/rust-azure-pipelines
      ref: refs/tags/v0.1.0
      endpoint: PipelinesTemplates # TODO YOU NEED TO CHANGE THIS!

stages:
- stage: check
  displayName: "Quick checks"
  jobs:
  - template: ci/scenarios/check.yml@rust_pipelines

- stage: test
  displayName: "Multi OS native tests"
  jobs:
  - template: ci/scenarios/test.yml@rust_pipelines
    parameters:
      min_rust_supported: 1.31  # Use first rust version you wanna support

You are done! Everything else is optional!

More stages:

Check and tests for embedded

Just modify `checks` and `tests`. This step use [cross project](https://github.com/rust-embedded/cross)

Check supported targets. Supported targets

the name parameter is because we can't change automatically the name mips-unknow-linux-musl to mips_unknow_linux_musl. Name has to be unique in embedded stage.

# This stage allow to easy test your crate using cross project. 
# Supported targets: https://github.com/rust-embedded/cross#supported-targets
- stage: embedded
  displayName: "Cross check and tests"
  dependsOn:
    - check
  jobs:
  - template: ci/scenarios/embeeded.yml@rust_pipelines
    parameters:
      checks:
        - target: mips-unknown-linux-musl
          name: cross_chcek_i686_unknown_freebsd
        - target: aarch64-unknown-linux-gnu
          name: cross_check_aarch64_unknown_linux_gnu
      tests:
        - target: i686-unknown-linux-gnu
          name: cross_test_i686_unknown_linux_gnu

Build and deploy to github

Parameter `gitHubConnection` need to be changed. [More info](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/github-release?view=azure-devops#prerequisites)
# This stage build binaries - you can deploy them in next stage
- stage: build
  displayName: "Builds"
  condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
  dependsOn:
    - test

# Deploy binaries to github only if tags start with `v` for example `v0.1.5`
- stage: deploy
  displayName: "Deploys"
  dependsOn:
    - build
  jobs: 
  - template: ci/scenarios/github/release.yml@rust_pipelines
    parameters:
      job_condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
      gitHubConnection: PipelinesTemplates # CHANGED THIS TO YOUR OWN VALUE

Add this repo templates to your project:

If you already have azure-piplines.yml file add this to be able using templates:

resources:
  repositories:
    - repository: rust_pipelines
      type: github
      name: xoac/rust-azure-pipelines
      # ref: refs/heads/master ## TODO you may want to change it to refs/tags/TAG_NAME.
      ref: refs/tags/v0.1.0
      endpoint: YOU_NEED_TO_SET_THIS

More about templates resources

And now you can use it like this:

jobs:
  - template: ci/jobs/cargo-check.yml@rust_pipelines

Available items:

ci
├── jobs
│   ├── cargo-build.yml
│   ├── cargo-check.yml
│   ├── cargo-clippy.yml
│   ├── cargo-doc.yml
│   ├── cargo-test.yaml
│   ├── cross-build.yml
│   ├── cross-check.yml
│   ├── cross-test.yml
│   └── rustfmt.yml
├── scenarios
│   ├── builds.yml
│   ├── check.yml
│   ├── embeeded.yml
│   ├── github
│   │   ├── deploy-doc.yml
│   │   └── release.yml
│   └── test.yml
└── steps
    ├── artifacts.yml
    ├── install-cross-rust.yml
    └── install-rust.yml

You can see ci/scenarios to get know how to use jobs.

Intuitive:

The ci is split into:

  • steps - common steps that are used in many jobs like install rust, publish artifacts etc.
  • jobs - here are defined jobs like rustfmt, cargo-*, clippy etc.
  • scenarios - groups jobs with good defaults parameters to allow easy check, test, build and deploy.

Using template jobs:

Most of pepole know how to use cargo. If you know you know also how to use this CI templates!

For example you wann use this:

cargo build --release --examples --target-dir "myTargetDir"

So you just need:

jobs:
 - template: ci/jobs/cargo-build.yml@rust_pipelines
   parameters:
     release: true
     examples: true
     target-dir: "myTargetDir"

How to check for more parameters? You can use just --help flag in cargo or see parameters in cargo-build.yml

cargo build --help

How to use run azure-pipelines?

  1. Create azure-pipelines.yml in your reposiotry
  2. Specify service connection
  3. Specify endpoint in resources.

How to deploy doc to github pages?

This is useful if u want to have a separate documentation for master branch.

Github part

  1. First you need to create a PAT (Personal Access Token) on Github. (recommended scopes for the token: repo, user, admin:repo_hook.)
  2. Then create a branch gh-pages and us it as repo page. Here you find how to do it

Azure part

  1. Go to your azure dev-ops pipeline project and click edit.
  2. Go inside variables:
  3. Add variable called DocPublishToken with value of your PAT(Personal Access Token). Don't forget to mark it as secret.
  4. Edit azure-pipelines.yml section with doc deploy (parameters.git) and you are done.

Example master doc generated for this example create. master doc for this hello word app


Sources:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].