generated from mdn/project-template
-
Notifications
You must be signed in to change notification settings - Fork 50
86 lines (72 loc) · 2.38 KB
/
test.yml
File metadata and controls
86 lines (72 loc) · 2.38 KB
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
name: Test
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
env:
BUILD_OUT_ROOT: ${{ github.workspace }}/build
steps:
- name: Checkout mdn/content
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: mdn/content
path: mdn/content
persist-credentials: false
- name: Checkout mdn/curriculum
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: mdn/curriculum
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: mdn/content/.nvmrc
cache: npm
cache-dependency-path: mdn/content/package-lock.json
- name: Install
run: npm ci
working-directory: mdn/content
- name: Build
working-directory: mdn/content
env:
CONTENT_ROOT: ${{ github.workspace }}/mdn/content/files
CURRICULUM_ROOT: ${{ github.workspace }}/mdn/curriculum
GITHUB_TOKEN: ${{ github.token }}
run: npx rari build --no-basic --curriculum --issues "$BUILD_OUT_ROOT/issues.json" --templ-stats
- name: Report
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
FILES_PATH: ${{ github.workspace }}/mdn/curriculum
ISSUES_PATH: ${{ env.BUILD_OUT_ROOT }}/issues.json
SCRIPT_PATH: ${{ github.workspace }}/mdn/curriculum/.github/scripts/report-issues.js
with:
script: |
const { reportIssues } = await import(process.env.SCRIPT_PATH);
await reportIssues({
core,
issuesPath: process.env.ISSUES_PATH,
filesPath: process.env.FILES_PATH
});
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: ".nvmrc"
cache: npm
- name: Install
run: npm ci
- name: Lint
run: |
npm run lint