-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.33 KB
/
test.yaml
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
# continuous integration
# run tests for repo
---
name: Test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Install xmllint
run: sudo apt-get install libxml2-utils
- name: Lint XML
# use `xargs` instead of `find -exec` so non-0 exit codes are correctly returned
run: >
find 106/ 20170701/
-name "*.xml"
! -name '*invalid*'
! -name '*error*'
| xargs xmllint --noout
- name: Check for extra whitespace at the start of elements
# invert exit code; grep normally returns 0 if match (linting issue) found
# use `xargs` instead of `find -exec` so non-0 exit codes are correctly returned
run: >
! find 106/ 20170701/
-name "*.xml"
! -name '*invalid*'
! -name '*error*'
| xargs grep --perl-regexp ">\s\w+"
- name: Check for extra whitespace at the end of elements
# invert exit code; grep normally returns 0 if match (linting issue) found
# use `xargs` instead of `find -exec` so non-0 exit codes are correctly returned
run: >
! find 106/ 20170701/
-name "*.xml"
! -name '*invalid*'
! -name '*error*'
| xargs grep --perl-regexp "\w\s+</"