-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (87 loc) · 3.42 KB
/
pr.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
96
97
98
99
name: Nacelle-JS - Pull Request
on:
pull_request:
branches: [main]
jobs:
PR:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all git history to prevent issues with SonarCloud analysis
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com/'
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
shopify-checkout:
- 'packages/shopify-checkout/**'
shopify-cart:
- 'packages/shopify-cart/**'
################################
# Shopify Checkout PR CICD #
################################
- name: Shopify Checkout - npm ci
if: steps.changes.outputs.shopify-checkout == 'true'
run: npm ci
working-directory: packages/shopify-checkout
- name: Shopify Checkout - npm run build
if: steps.changes.outputs.shopify-checkout == 'true'
run: npm run build
working-directory: packages/shopify-checkout
- name: Shopify Checkout - npm run test:coverage
if: steps.changes.outputs.shopify-checkout == 'true'
run: npm run test:coverage
working-directory: packages/shopify-checkout
- name: Analyze with SonarCloud
if: steps.changes.outputs.shopify-checkout == 'true'
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: packages/shopify-checkout
args: >
-Dsonar.organization=getnacelle
-Dsonar.projectKey=getnacelle_nacelle-js_package_shopify_checkout
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.sources=src
-Dsonar.exclusions=src/**/*.test.ts,src/**/*.spec.ts
-Dsonar.tests=src
-Dsonar.test.inclusions=src/**/*.test.ts,src/**/*.spec.ts
################################
# Shopify Cart PR CICD #
################################
- name: Shopify Cart - npm ci
if: steps.changes.outputs.shopify-cart == 'true'
run: npm ci
working-directory: packages/shopify-cart
- name: Shopify Cart - npm run build
if: steps.changes.outputs.shopify-cart == 'true'
run: npm run build
working-directory: packages/shopify-cart
- name: Shopify Cart - npm run test:coverage
if: steps.changes.outputs.shopify-cart == 'true'
run: npm run test:coverage
working-directory: packages/shopify-cart
- name: Analyze with SonarCloud
if: steps.changes.outputs.shopify-cart == 'true'
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: packages/shopify-cart
args: >
-Dsonar.organization=getnacelle
-Dsonar.projectKey=getnacelle_nacelle-js_package_shopify_cart
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.sources=src
-Dsonar.exclusions=src/**/*.test.ts,src/**/*.spec.ts
-Dsonar.tests=src
-Dsonar.test.inclusions=src/**/*.test.ts,src/**/*.spec.ts