aboutsummaryrefslogtreecommitdiff
path: root/Jenkinsfile
blob: d48dccd0a68b37f951beebc0c46706771a6ade3c (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
pipeline {
  agent {
    docker {
      image 'mcr.microsoft.com/dotnet/core/sdk'
      reuseNode true
    }

  }
  stages {
    stage('检出') {
      steps {
        checkout([
          $class: 'GitSCM',
          branches: [[name: env.GIT_BUILD_REF]],
          userRemoteConfigs: [[
            url: env.GIT_REPO_URL,
            credentialsId: env.CREDENTIALS_ID
          ]]])
        }
      }
      stage('构建与测试') {
        steps {
          sh 'dotnet test --logger:"html;LogFileName=index.html" --collect:"XPlat Code Coverage" --settings \'./Timeline.Tests/coverletArgs.runsettings\''
          codingHtmlReport(name: 'test-result', path: 'Timeline.Tests/TestResults/', entryFile: 'index.html')
        }
      }
    }
    environment {
      ASPNETCORE_ENVIRONMENT = 'Development'
    }
  }