Skip to content

Commit a6b0daf

Browse files
authored
Merge Azure pipelines and GitHub actions (microsoft#298)
* add tests to ap and git act * remove 6 * try tests using matrix * remove mentions of specific versions * try version 6 * change node order * add node 6 tests * add test to az pipelines, remove git from readme * remove github test file * fix indent * add space * test incorrect node versions * fix node vesrsions * add different art names * add variable to prevent publishBuild running * fix variables * swap node 8 to the end and remove v-spec art path * separate publish build into a separate stage * add condition * fix indent * change job naming * remove tests from build job * add condition for prev jobs successs * change in to eq * swap condition places * add dependency * user loops for pipelienes * change loop * move loop line * indent * change values to default * remove quotations * change param tpye * add npm install * remove type * remove version 6 * add depends on build * add dependency * change to a single job * remove unnecessary npm Co-authored-by: Ilya Kuleshov <[email protected]>
1 parent 3d89e97 commit a6b0daf

File tree

3 files changed

+40
-61
lines changed

3 files changed

+40
-61
lines changed

.github/workflows/all-tests.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
<a href="https://github.com/microsoft/typed-rest-client"><img alt="GitHub Actions status" src="https://github.com/microsoft/typed-rest-client/workflows/all-tests/badge.svg"></a>
3-
42
[![Build Status](https://dev.azure.com/ms/typed-rest-client/_apis/build/status/Microsoft.typed-rest-client?branchName=master)](https://dev.azure.com/ms/typed-rest-client/_build/latest?definitionId=42&branchName=master)
53

64

azure-pipelines.yml

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,43 @@
1-
strategy:
2-
matrix:
3-
'Node 6':
4-
versionSpec: '6.x'
5-
'Node 8':
6-
versionSpec: '8.x'
7-
'Node 10':
8-
versionSpec: '10.x'
9-
'Node 12':
10-
versionSpec: '12.x'
11-
'Node 14':
12-
versionSpec: '14.x'
13-
steps:
14-
- task: NodeTool@0
15-
inputs:
16-
versionSpec: $(versionSpec)
17-
displayName: Install node
1+
parameters:
2+
- name: versionSpec
3+
type: object
4+
default:
5+
- '6.x'
6+
- '8.x'
7+
- '10.x'
8+
- '12.x'
9+
- '14.x'
1810

19-
# install dependencies
20-
- script: npm install
21-
displayName: npm install
11+
jobs:
12+
- job: build_test_and_publish
13+
displayName: Build, test and publish
14+
steps:
15+
#build on node 8.x
16+
- task: NodeTool@0
17+
inputs:
18+
versionSpec: '8.x'
19+
displayName: Install node
2220

23-
# build
24-
- script: npm run build
25-
displayName: npm run build
21+
- script: npm install
22+
displayName: npm install
2623

27-
- script: npm run units
28-
displayName: npm run units
29-
30-
# publish build artifacts to drop folder so we can use them for release
31-
- task: PublishBuildArtifacts@1
32-
inputs:
33-
PathtoPublish: "_build"
34-
ArtifactName: "drop"
35-
ArtifactType: "Container"
36-
displayName: Publish build artifacts
24+
- script: npm run build
25+
displayName: npm run build
26+
#run unit tests on different node versions
27+
- ${{ each version in parameters.versionSpec }}:
28+
- task: NodeTool@0
29+
inputs:
30+
versionSpec: ${{ version }}
31+
displayName: Install node
32+
- script: npm run units
33+
displayName: npm run units
34+
- script: npm run test
35+
displayName: npm run test
36+
#publish if needed
37+
- task: PublishBuildArtifacts@1
38+
condition: and(succeeded(), in(variables['publishBuild'], 'true'))
39+
inputs:
40+
PathtoPublish: "_build"
41+
ArtifactName: "drop"
42+
ArtifactType: "Container"
43+
displayName: Publish build artifacts

0 commit comments

Comments
 (0)