forked from lwg/issues
-
Notifications
You must be signed in to change notification settings - Fork 28
54 lines (45 loc) · 1.58 KB
/
check-pr.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
# A workflow to check generating the HTML lists works.
# The pages generated by this will have incorrect "Last modified" dates
# for the issues, because there is no meta-date/dates file used here.
# That's OK, because this is just a quick check to ensure that the XML
# is well-formed and the lists can be generated, suitable for checking
# pull requests are OK to merge.
name: Generate HTML issues for a pull request
on:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Compile binary programs
run: make CXX=g++-14 pgms
- name: Extract issue timestamps from published files
run: |
git fetch --depth=1 origin gh-pages
git worktree add gh-pages FETCH_HEAD
rm -f meta-data/dates
for i in gh-pages/issue[0-9]*.html ; do
n="${i#gh-pages/issue}" ; n="${n%.html}" ;
date=`sed -n 's;^.*Last modified:</b> \(....-..-..\)</p>$;\1;p' $i`
date "+$n %s" -d "$date" >> meta-data/dates
done
- name: Generate HTML lists
run: make lists
- name: Package changed files
run: |
cp mailing/issue*.html gh-pages/
mkdir html
git -C gh-pages add issue*.html
git -C gh-pages diff --cached --name-only | while read f ; do
cp gh-pages/$f html
done
- name: Upload new HTML files for inspection
uses: actions/upload-artifact@v4
with:
name: pull-${{ github.event.number }}-html
path: html/issue*.html
retention-days: 7