-
Notifications
You must be signed in to change notification settings - Fork 25
93 lines (86 loc) · 2.93 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
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
npx playwright install-deps
- name: Build
run: npm run build
- name: Validate Translations
run: npm run test:translations
- name: Accessibility Tests
run: npm run test:axe
- name: Unit Tests
run: npm run test:headless
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::037018655140:role/brightspace-ui-core.d2l.dev-githubactions-access
role-duration-seconds: 3600
aws-region: ca-central-1
- name: Publish
uses: ./.github/actions/publish-to-s3/
with:
BUCKET_PATH: s3://brightspace-ui-core.d2l.dev/branches/pr-${{ github.event.number }}
PUBLISH_DIRECTORY: ./build/
- name: Notify
uses: ./.github/actions/comment-on-pr/
with:
MESSAGE: |
Thanks for the PR! 🎉
We've deployed an automatic preview for this PR - you can see your changes here:
| URL | https://pr-${{ github.event.number }}-brightspace-ui-core.d2l.dev/ |
|---|---|
> **Note**
> The build needs to finish before your changes are deployed.
> Changes to the PR will automatically update the instance.
ONLY_POST_ONCE: true