-
Notifications
You must be signed in to change notification settings - Fork 1.2k
92 lines (81 loc) · 2.83 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
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
name: CI
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: configure Hugo and Pagefind version
run: |
set -x &&
echo "HUGO_VERSION=$(sed -n 's/^ *hugo_version: *//p' <hugo.yml)" >>$GITHUB_ENV
echo "PAGEFIND_VERSION=$(sed -n 's/^ *pagefind_version: *//p' <hugo.yml)" >>$GITHUB_ENV
- name: install Hugo ${{ env.HUGO_VERSION }}
run: |
set -x &&
curl -Lo /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_${HUGO_VERSION}_linux-amd64.deb &&
sudo dpkg -i /tmp/hugo.deb
- name: run Hugo to build the pages
run: hugo
- name: ensure that there are no absolute URLs
run: |
set -x
if git grep --untracked --no-exclude-standard "\\(href\|src\) *= *[\"']/" \
-- public/ ':^public/js/jquery*' >/tmp/abs-urls.txt
then
cat /tmp/abs-urls.txt
exit 1
fi
- name: run Pagefind ${{ env.PAGEFIND_VERSION }} to build the search index
run: npx -y pagefind@${{ env.PAGEFIND_VERSION }} --site public
- name: build tar archive
run: cd public && tar czvf ../pages.tar.gz *
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: pages
path: pages.tar.gz
- name: verify search results
run: |
set -x
res=0
for term in commit config log rev-parse
do
node ./script/run-pagefind.js "$term" | tee search.results >&2
grep "^1. /docs/git-$term\\.html" search.results || {
echo "::error::Search for $term failed to show the manual page first" >&2
res=1
}
done
exit $res
- name: check for broken links
id: lychee
uses: lycheeverse/lychee-action@v2
with:
args: >-
--offline
--fallback-extensions html
--exclude file:///path/to/repo.git/
--exclude file:///caminho/para/o/reposit%C3%B3rio.git/
--exclude file:///ruta/a/repositorio.git/
--exclude file:///sl%C3%B3%C3%B0/til/hirsla.git/
--exclude file:///Pfad/zum/Repo.git/
--exclude file:///chemin/du/d%C3%A9p%C3%B4t.git/
--exclude file:///srv/git/project.git
public/
output: lychee.md
jobSummary: true
- name: Install @playwright/test
run: npm install @playwright/test
- name: Run Playwright tests
id: playwright
env:
PLAYWRIGHT_TEST_URL: http://localhost:5000/
run: |
echo "result=$PLAYWRIGHT_TEST_URL" >>$GITHUB_OUTPUT &&
npx playwright test --project=chrome
- uses: actions/upload-artifact@v4
if: always() && steps.playwright.outputs.result != ''
with:
name: playwright-report
path: playwright-report/