95 lines (81 loc) · 2.74 KB
/
build-steps.yml
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
84
85
86
87
88
89
90
91
92
93
94
95
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Run CI
on:
push:
branches:
- 'dev'
- 'master'
pull_request:
paths:
- 'lib/**/*'
- '!**.md'
- '.github/workflows/build-steps.yml'
concurrency:
group: ci-${{github.ref}}
cancel-in-progress: true
jobs:
pre-check:
runs-on: ubuntu-latest
outputs:
# Expose matched filters as job 'packages' output variable
packages: ${{ steps.filter.outputs.changes }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
# &common and &browser are YAML anchors
# *common and *browser references previously defined anchor
# browser/node filter will match any path under common as well as their own
# angular/react filter will match any path under common and browser as well as their own
filters: |
core:
- 'lib/msal-core/**/**.!(md)'
- '.github/workflows/build-steps.yml'
common: &common
- 'lib/msal-common/**/**.!(md)'
- '.github/workflows/build-steps.yml'
browser: &browser
- *common
- 'lib/msal-browser/**/**.!(md)'
node:
- *common
- 'lib/msal-node/**/**.!(md)'
angular:
- *browser
- 'lib/msal-angular/**/**.!(md)'
react:
- *browser
- 'lib/msal-react/**/**.!(md)'
build-test:
needs: pre-check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Parse JSON array containing names of all filters matching any of changed files
# e.g. ['package1', 'package2'] if both package folders contains changes
library: ${{ fromJSON(needs.pre-check.outputs.packages) }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- name: Clean Install
env:
RUNNING_NODE_CI: 1
run: npm ci
- name: Build packages
working-directory: lib/msal-${{ matrix.library }}
run: npm run build:all
- name: Lint
working-directory: lib/msal-${{ matrix.library }}
run: npm run lint
- name: Unit Tests with coverage
working-directory: lib/msal-${{ matrix.library }}
run: npm run test:coverage
- name: Upload Test Coverage to CodeCov
if: success()
uses: codecov/codecov-action@v1
with:
files: lib/msal-${{matrix.library}}/coverage/lcov.info
flags: msal-${{ matrix.library }}