-
Notifications
You must be signed in to change notification settings - Fork 509
80 lines (66 loc) · 2.76 KB
/
developing.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
name: Developing with Yari
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: mdn/content
path: mdn/content
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: yarn
- name: Cache @vscode/ripgrep bin
uses: actions/cache@v4
with:
key: vscode-ripgrep-bin-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('yarn.lock') }}
path: node_modules/@vscode/ripgrep/bin/
- name: Install all yarn packages
run: yarn --frozen-lockfile
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup kernel for react native, increase watchers
run: |
# When running Yari on Linux, you might get the
# "Error: ENOSPC: System limit for number of file watchers reached" error.
# This, resolves that.
# Source https://github.com/expo/expo-github-action/issues/20#issuecomment-541676895
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Start the dev server
env:
REACT_APP_WRITER_MODE: true
# Remember, the mdn/content repo got cloned into `pwd` into a
# sub-folder called "mdn/content"
CONTENT_ROOT: "${{ github.workspace }}/mdn/content/files"
run: |
# Sanity check that the mdn/kitchensink page is there. If you don't do
# this, and the file has accidentally or intentionally been deleted,
# unfortunately the error messaging can be very misleading because the
# tests would assume there's something wrong with the code instead of
# the content if loading this page fails.
ls "$CONTENT_ROOT/en-us/mdn/kitchensink"
yarn build:prepare
yarn start > /tmp/stdout.log 2> /tmp/stderr.log &
- name: Wait for servers
run: |
# Just a slight delay to wait until the dev server is ready.
sleep 3
curl --retry-connrefused --retry 5 http://localhost:5042 > /dev/null
curl --retry-connrefused --retry 5 --silent http://localhost:3000 > /dev/null
- name: Test viewing the dev server
run: |
yarn test:developing
- name: Debug server's stdout and stderr if tests failed
if: failure()
run: |
echo "STDOUT..................................................."
cat /tmp/stdout.log
echo ""
echo "STDERR..................................................."
cat /tmp/stderr.log