File tree 2 files changed +68
-0
lines changed
2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Test pubs against website
2
+
3
+ on :
4
+ # Pushes / merges to master
5
+ push :
6
+ branches :
7
+ - master
8
+ # On creation and updating of PR
9
+ pull_request :
10
+ types : [opened, reopened, synchronize]
11
+ # Only those targeting master branch
12
+ branches :
13
+ - master
14
+
15
+ jobs :
16
+ test :
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - name : Checkout pubs
20
+ uses : actions/checkout@v3
21
+ with :
22
+ path : pubs
23
+ - name : Checkout prl-website
24
+ uses : actions/checkout@v3
25
+ with :
26
+ token : ${{ secrets.READ_PAT }}
27
+ ref : master
28
+ repository : personalrobotics/prl-website
29
+ path : prl-website
30
+ - name : Setup Python
31
+ uses : actions/setup-python@v4
32
+ with :
33
+ python-version : ' 3.x'
34
+ cache : pip
35
+ cache-dependency-path : prl-website/setup.py
36
+ - name : Install PRL website
37
+ run : pip install -e ./prl-website/
38
+ - name : Run Test
39
+ run : python pubs/test_pubs.py
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ ### Test all bib files
3
+ ### Requires installation of github.com/personalrobotics/prl-website
4
+
5
+ from personalrobotics .main .publications import RenderableEntry
6
+ import os
7
+ import sys
8
+
9
+ import pybtex .database
10
+
11
+ if __name__ == "__main__" :
12
+ bibdir = os .path .dirname (os .path .realpath (__file__ ))
13
+ for filename in os .listdir (bibdir ):
14
+ if not filename .endswith ('.bib' ):
15
+ continue
16
+ print ("Checking Bib File: " + filename )
17
+
18
+ with open (os .path .join (bibdir , filename ), 'r' ) as file :
19
+ try :
20
+ database = pybtex .database .parse_string (file .read (), "bibtex" )
21
+ entries = [RenderableEntry ("Publication" , e ) for e in database .entries .values ()]
22
+ for entry in entries :
23
+ entry .__str__ ()
24
+ except Exception as e :
25
+ print (type (e ))
26
+ print (e .args )
27
+ print (e )
28
+ sys .exit (- 1 )
29
+
You can’t perform that action at this time.
0 commit comments