summaryrefslogtreecommitdiffstats
path: root/azure-pipelines.yml
blob: 73568a16be8642a30c0e55cd524ae522ca3ef1dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
trigger:
  branches:
    include: ["*"]
  tags:
    include: ["*"]

jobs:
  # Check formatting
  - template: ci/rustfmt.yml
    parameters:
      name: rustfmt
      displayName: Check formatting

  # Run linter
  - template: ci/cargo-clippy.yml
    parameters:
      name: cargo_clippy
      displayName: Run linter

  # Cargo check
  - template: ci/cargo-check.yml
    parameters:
      name: cargo_check
      displayName: Cargo check

  ##############
  # Test stage #
  ##############

  # Test stable
  - template: ci/test.yml
    parameters:
      dependsOn:
        - cargo_check
      name: cargo_test_stable
      displayName: Cargo test
      cross: true # Test on Windows and macOS

  # Test nightly
  - template: ci/test.yml
    parameters:
      name: cargo_test_nightly
      displayName: Cargo test
      rust_version: nightly

  # Test docker
  # Runs integration tests as a starship developer would run them locally
  - template: ci/test-docker.yml
    parameters:
      name: test_docker
      displayName: Docker test

  ################
  # Release stage #
  ################

  # Release binary
  - template: ci/github-release.yml
    parameters:
      name: github_release
      dependsOn:
        - rustfmt
        - cargo_check
        - cargo_clippy
        - cargo_test_stable
        - test_docker
      rust_version: stable
      condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
      contents: |
        *
        !*.rlib
        !*.d
        !.*
      targets:
        - x86_64-unknown-linux-gnu
        # Windows support temporarily disabled
        # - x86_64-pc-windows-gnu
        # - x86_64-pc-windows-msvc
        - x86_64-apple-darwin
      github:
        gitHubConnection: StarshipRelease
        repositoryName: starship/starship
        isPreRelease: false