File tree Expand file tree Collapse file tree 2 files changed +22
-19
lines changed Expand file tree Collapse file tree 2 files changed +22
-19
lines changed Original file line number Diff line number Diff line change 11name : JSON Schema
22on :
33 - push
4+ - pull_request
5+
46jobs :
57 specs :
6- runs-on : ubuntu-22.04
8+ runs-on : ubuntu-latest
79 steps :
8- - uses : actions/checkout@v3
9- - uses : actions/setup-python@v4
10- with :
11- python-version : " 3.10"
12- - run : pip install --requirement requirements.txt
13- - run : xml2rfc --version
14- - run : make all
15- - uses : actions/upload-artifact@v3
16- with :
17- name : specification-docs
18- path : |
19- *.html
20- *.txt
21- !requirements.txt
10+ - uses : actions/checkout@v4
11+ - uses : actions/setup-node@v4
12+ with :
13+ node-version : latest
14+ cache : npm
15+ - run : npm ci
16+ - run : npm run lint
17+ - run : npm run build-all
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ dotenv.config();
2323
2424const build = async ( filename ) => {
2525 const md = readFileSync ( filename , "utf-8" ) ;
26- const html = await remark ( )
26+ const file = await remark ( )
2727 . use ( remarkPresetLintMarkdownStyleGuide )
2828 . use ( remarkGfm )
2929 . use ( remarkHeadingId )
@@ -164,11 +164,13 @@ const build = async (filename) => {
164164 </style>
165165 </head>
166166 <body>
167- ${ html . toString ( ) }
167+ ${ file . toString ( ) }
168168 </body>
169169</html>` ) ;
170170
171- console . error ( reporter ( html ) ) ;
171+ console . error ( reporter ( file ) ) ;
172+
173+ return file . messages . length ;
172174} ;
173175
174176( async function ( ) {
@@ -177,9 +179,14 @@ const build = async (filename) => {
177179 console . error ( "WARNING: No files built. Usage: 'npm run build -- filename.md'" ) ;
178180 }
179181
182+ let messageCount = 0 ;
180183 for ( const filename of files ) {
181184 console . log ( `Building: ${ filename } ...` ) ;
182- await build ( filename ) ;
185+ messageCount += await build ( filename ) ;
183186 console . log ( "" ) ;
184187 }
188+
189+ if ( messageCount > 0 ) {
190+ process . exit ( 1 ) ;
191+ }
185192} ( ) ) ;
You can’t perform that action at this time.
0 commit comments