-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (62 loc) · 1.85 KB
/
XrmEx.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
name: XrmEx
on:
push:
pull_request:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
Prepare_and_Build:
runs-on: ubuntu-latest
outputs:
isMainRepo: ${{ steps.check-repo.outputs.isMainRepo }}
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v3
- run: npm ci
- name: Dependencies audit
run: npm audit --audit-level=moderate
- name: Build
run: npm run build
- name: Format check
run: npm run format:check
- name: Lint check
run: npm run lint:check
- name: Check Repository
id: check-repo
run: echo "::set-output name=isMainRepo::$(if [ "${{ github.repository }}" == "AhashSritharan/Xrm-Ex" ]; then echo true; else echo false; fi)"
Playwright_Test:
needs: Prepare_and_Build
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.39.0-jammy
steps:
- uses: actions/checkout@v3
- name: Run Playwright tests
run: |
if ${{ needs.Prepare_and_Build.outputs.isMainRepo }}; then
npx playwright test
else
npx playwright test contact.spec.ts
fi
env:
ENV_VAR_JSON: ${{ secrets.ENV_VAR_JSON }}
- name: Upload Playwright Report
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-report
path: playwright-report/
retention-days: 30
Release_and_Upload:
needs: Playwright_Test
runs-on: ubuntu-latest
if: needs.Prepare_and_Build.outputs.isMainRepo == 'true'
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v3
- run: npm ci
- name: Release
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}