-
Notifications
You must be signed in to change notification settings - Fork 51
155 lines (127 loc) · 5.14 KB
/
Copy pathcheck.yaml
File metadata and controls
155 lines (127 loc) · 5.14 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# This workflow runs for every pull request to lint and test the proposed changes.
name: Check
on:
pull_request:
# Push to master will trigger code checks
push:
branches:
- master
tags-ignore:
- '**' # Ignore all tags to prevent duplicate builds when tags are pushed.
# Release flow will trigger checks manually
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
name: Build & Test
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20, 22, 24]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.3.0
- name: Install Chrome for puppeteer
run: pnpm exec puppeteer browsers install chrome
- name: Run Tests
run: pnpm test
test_bundling:
name: Test bundler support
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.3.0
- name: Run Tests
run: pnpm test:bundling
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.3.0
- run: pnpm lint
- name: Format check
run: pnpm format:check
docs:
name: Docs build
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
steps:
- name: Checkout Source code
uses: actions/checkout@v7
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.3.0
- name: Build docs
run: |
cd website
pnpm lint
pnpm build
- name: Run Lychee Link Checker
id: lychee
if: github.event_name == 'pull_request'
uses: lycheeverse/lychee-action@v2.8.0
with:
fail: false
args: >
--base-url https://docs.apify.com
--max-retries 6
--exclude="github.com"
--exclude="npmjs.com"
--exclude="docs\.apify\.com/api/client/js/assets/"
--no-progress
--timeout '60'
--accept '100..=103,200..=299,429'
--max-redirects 5
--format markdown
'./website/build/**/*.html'
- name: Find Comment
if: github.event_name == 'pull_request'
uses: peter-evans/find-comment@v4
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: There are broken links in the documentation.
- name: Links are passing
if: github.event_name == 'pull_request' && steps.lychee.outputs.exit_code == 0 && steps.find-comment.outputs.comment-id
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
✅ The link checker did not find any broken links.
See more at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#summary-${{ job.check_run_id }}
edit-mode: replace
- name: Links are failing
if: github.event_name == 'pull_request' && steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
⚠️ There are broken links in the documentation.
See more at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#summary-${{ job.check_run_id }}
edit-mode: replace