-
Notifications
You must be signed in to change notification settings - Fork 25
115 lines (108 loc) · 3.88 KB
/
ci.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: CI
on: pull_request
jobs:
lint:
name: Lint
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- uses: Brightspace/third-party-actions@actions/checkout
- uses: Brightspace/third-party-actions@actions/setup-node
with:
node-version-file: .nvmrc
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Lint (JavaScript)
run: npm run lint:eslint
- name: Lint (CSS)
run: npm run lint:style
playwright:
name: Accessibility and Unit Tests
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: Brightspace/third-party-actions@actions/checkout
- uses: Brightspace/third-party-actions@actions/setup-node
with:
node-version-file: .nvmrc
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Validate Translations
run: npm run test:translations
- name: Validate custom-elements.json
run: npm run test:wca
- name: Accessibility Tests
id: at
run: npm run test:axe
- name: Upload test report
if: >
always() &&
github.triggering_actor != 'dependabot[bot]' &&
(steps.at.outcome == 'failure' || steps.at.outcome == 'success')
uses: Brightspace/test-reporting-action@main
with:
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
aws-session-token: ${{secrets.AWS_SESSION_TOKEN}}
- name: Unit Tests
id: ut
run: npm run test:unit
- name: Upload test report
if: >
always() &&
github.triggering_actor != 'dependabot[bot]' &&
(steps.ut.outcome == 'failure' || steps.ut.outcome == 'success')
uses: Brightspace/test-reporting-action@main
with:
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
aws-session-token: ${{secrets.AWS_SESSION_TOKEN}}
publish:
name: Publish static site
if: ${{ github.triggering_actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: Brightspace/third-party-actions@actions/checkout
- uses: Brightspace/third-party-actions@actions/setup-node
with:
node-version-file: .nvmrc
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Build static
run: npm run build-static
- name: Assume role
uses: Brightspace/third-party-actions@aws-actions/configure-aws-credentials
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
role-to-assume: arn:aws:iam::022062736489:role/r+BrightspaceUI+core+repo
role-duration-seconds: 3600
aws-region: ca-central-1
- name: Publish
uses: BrightspaceUI/actions/publish-to-s3@main
with:
bucket-path: s3://d2l.dev/live/prs/${{ github.repository }}/pr-${{ github.event.number }}
publish-directory: ./build/
- name: Notify
uses: BrightspaceUI/actions/comment-on-pr@main
with:
message: |
Thanks for the PR! 🎉
We've deployed an automatic preview for this PR - you can see your changes here:
| URL | https://live.d2l.dev/prs/${{ github.repository }}/pr-${{ github.event.number }}/ |
|---|---|
> [!NOTE]
> The build needs to finish before your changes are deployed.
> Changes to the PR will automatically update the instance.
post-mode: once