generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 104
49 lines (46 loc) · 1.59 KB
/
PR-SAP.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
name: PR Build (SAP)
on:
pull_request:
branches: [main]
concurrency:
group: pr-sap-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-sap:
runs-on: ubuntu-latest
if: '! github.event.pull_request.head.repo.fork'
steps:
- name: Checkout SAP repo
run: |
git config --global credential.helper "cache --timeout=3600"
echo -e "url=https://user:${GH_TOKEN}@github.com\n" | git credential approve
echo -e "url=https://user:${GH_TOKEN_PARENT}@github.tools.sap\n" | git credential approve
git clone --depth 1 --no-single-branch https://github.tools.sap/cap/docs docs
cd docs
git checkout $GITHUB_HEAD_REF || git checkout main
git submodule update --init --recursive
cd @external
git checkout $GITHUB_HEAD_REF
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN_PARENT: ${{ secrets.GH_TOKEN_PARENT }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: docs/package-lock.json
- run: npm ci
working-directory: docs
- run: npm test
working-directory: docs
- run: npm run docs:build
working-directory: docs
env:
NODE_OPTIONS: "--max-old-space-size=6144"
- name: Find broken anchor links
working-directory: docs
run: |
npm run docs:preview -- --port 5555 &
sleep 2
.github/etc/blc.js http://localhost:5555/docs/