-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (55 loc) · 1.92 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
name: CI
on: [push]
jobs:
javascript-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
with:
node-version: 20.8.1
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Lint
run: yarn lint
- name: Tests
run: yarn test
- name: Code formatting
run: yarn fmt:check
- name: typechecking
run: yarn typecheck
test-e2e:
env:
OCW_STUDIO_BASE_URL: ${{ secrets.OCW_STUDIO_BASE_URL }}
SEARCH_API_URL: ${{ secrets.SEARCH_API_URL }}
STATIC_API_BASE_URL: ${{ secrets.STATIC_API_BASE_URL }}
RESOURCE_BASE_URL: ${{ secrets.RESOURCE_BASE_URL }}
COURSE_HUGO_CONFIG_PATH: "$GITHUB_WORKSPACE/ocw-hugo-projects/ocw-course-v2/config.yaml"
WWW_HUGO_CONFIG_PATH: "$GITHUB_WORKSPACE/ocw-hugo-projects/ocw-www/config.yaml"
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
with:
node-version: 20
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
repository: "mitodl/ocw-hugo-projects"
ref: "main"
path: "ocw-hugo-projects"
- name: Install dependencies
run: yarn
- name: Run e2e jest tests
run: yarn test:e2e:jest
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: yarn test:e2e
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30