vendor/github.com/pelletier/go-toml/azure-pipelines.yml
changeset 251 1c52a0eeb952
child 256 6d9efbef00a9
equal deleted inserted replaced
250:c040f992052f 251:1c52a0eeb952
       
     1 trigger:
       
     2 - master
       
     3 
       
     4 stages:
       
     5 - stage: fuzzit
       
     6   displayName: "Run Fuzzit"
       
     7   dependsOn: []
       
     8   condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master'))
       
     9   jobs:
       
    10   - job: submit
       
    11     displayName: "Submit"
       
    12     pool:
       
    13       vmImage: ubuntu-latest
       
    14     steps:
       
    15     - task: GoTool@0
       
    16       displayName: "Install Go 1.13"
       
    17       inputs:
       
    18         version: "1.13"
       
    19     - script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/"
       
    20     - script: mkdir -p ${HOME}/go/src/github.com/pelletier/go-toml
       
    21     - script: cp -R . ${HOME}/go/src/github.com/pelletier/go-toml
       
    22     - task: Bash@3
       
    23       inputs:
       
    24         filePath: './fuzzit.sh'
       
    25       env:
       
    26         TYPE: fuzzing
       
    27         FUZZIT_API_KEY: $(FUZZIT_API_KEY)
       
    28 
       
    29 - stage: run_checks
       
    30   displayName: "Check"
       
    31   dependsOn: []
       
    32   jobs:
       
    33   - job: fmt
       
    34     displayName: "fmt"
       
    35     pool:
       
    36       vmImage: ubuntu-latest
       
    37     steps:
       
    38     - task: GoTool@0
       
    39       displayName: "Install Go 1.13"
       
    40       inputs:
       
    41         version: "1.13"
       
    42     - task: Go@0
       
    43       displayName: "go fmt ./..."
       
    44       inputs:
       
    45         command: 'custom'
       
    46         customCommand: 'fmt'
       
    47         arguments: './...'
       
    48   - job: coverage
       
    49     displayName: "coverage"
       
    50     pool:
       
    51       vmImage: ubuntu-latest
       
    52     steps:
       
    53     - task: GoTool@0
       
    54       displayName: "Install Go 1.13"
       
    55       inputs:
       
    56         version: "1.13"
       
    57     - task: Go@0
       
    58       displayName: "Generate coverage"
       
    59       inputs:
       
    60         command: 'test'
       
    61         arguments: "-race -coverprofile=coverage.txt -covermode=atomic"
       
    62     - task: Bash@3
       
    63       inputs:
       
    64         targetType: 'inline'
       
    65         script: 'bash <(curl -s https://codecov.io/bash) -t $(CODECOV_TOKEN)'
       
    66   - job: benchmark
       
    67     displayName: "benchmark"
       
    68     pool:
       
    69       vmImage: ubuntu-latest
       
    70     steps:
       
    71     - task: GoTool@0
       
    72       displayName: "Install Go 1.13"
       
    73       inputs:
       
    74         version: "1.13"
       
    75     - script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/"
       
    76     - task: Bash@3
       
    77       inputs:
       
    78         filePath: './benchmark.sh'
       
    79         arguments: "master $(Build.Repository.Uri)"
       
    80 
       
    81   - job: fuzzing
       
    82     displayName: "fuzzing"
       
    83     pool:
       
    84       vmImage: ubuntu-latest
       
    85     steps:
       
    86     - task: GoTool@0
       
    87       displayName: "Install Go 1.13"
       
    88       inputs:
       
    89         version: "1.13"
       
    90     - script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/"
       
    91     - script: mkdir -p ${HOME}/go/src/github.com/pelletier/go-toml
       
    92     - script: cp -R . ${HOME}/go/src/github.com/pelletier/go-toml
       
    93     - task: Bash@3
       
    94       inputs:
       
    95         filePath: './fuzzit.sh'
       
    96       env:
       
    97         TYPE: local-regression
       
    98 
       
    99   - job: go_unit_tests
       
   100     displayName: "unit tests"
       
   101     strategy:
       
   102       matrix:
       
   103         linux 1.13:
       
   104           goVersion: '1.13'
       
   105           imageName: 'ubuntu-latest'
       
   106         mac 1.13:
       
   107           goVersion: '1.13'
       
   108           imageName: 'macos-10.13'
       
   109         windows 1.13:
       
   110           goVersion: '1.13'
       
   111           imageName: 'vs2017-win2016'
       
   112         linux 1.12:
       
   113           goVersion: '1.12'
       
   114           imageName: 'ubuntu-latest'
       
   115         mac 1.12:
       
   116           goVersion: '1.12'
       
   117           imageName: 'macos-10.13'
       
   118         windows 1.12:
       
   119           goVersion: '1.12'
       
   120           imageName: 'vs2017-win2016'
       
   121     pool:
       
   122       vmImage: $(imageName)
       
   123     steps:
       
   124     - task: GoTool@0
       
   125       displayName: "Install Go $(goVersion)"
       
   126       inputs:
       
   127         version: $(goVersion)
       
   128     - task: Go@0
       
   129       displayName: "go test ./..."
       
   130       inputs:
       
   131         command: 'test'
       
   132         arguments: './...'
       
   133 
       
   134 - stage: build_docker_image
       
   135   displayName: "Build Docker image"
       
   136   dependsOn: run_checks
       
   137   jobs:
       
   138   - job: build
       
   139     displayName: "Build"
       
   140     pool:
       
   141       vmImage: ubuntu-latest
       
   142     steps:
       
   143     - task: Docker@2
       
   144       inputs:
       
   145         command: 'build'
       
   146         Dockerfile: 'Dockerfile'
       
   147         buildContext: '.'
       
   148         addPipelineData: false
       
   149 
       
   150 - stage: publish_docker_image
       
   151   displayName: "Publish Docker image"
       
   152   dependsOn: build_docker_image
       
   153   condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master'))
       
   154   jobs:
       
   155   - job: publish
       
   156     displayName: "Publish"
       
   157     pool:
       
   158       vmImage: ubuntu-latest
       
   159     steps:
       
   160     - task: Docker@2
       
   161       inputs:
       
   162         containerRegistry: 'DockerHub'
       
   163         repository: 'pelletier/go-toml'
       
   164         command: 'buildAndPush'
       
   165         Dockerfile: 'Dockerfile'
       
   166         buildContext: '.'
       
   167         tags: 'latest'