summaryrefslogtreecommitdiff
path: root/.github/workflows/check_misc.yml
blob: 2a59e74066a569dbd86331fed530f9f9ada354ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
name: Miscellaneous checks
on: [push, pull_request]

concurrency:
  group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
  cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }}

jobs:
  checks:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Check if C-sources are US-ASCII
        run: |
          ! grep -r -n '[^	 -~]' *.[chy] include internal win32/*.[ch]
      - name: Check for trailing spaces
        run: |
          ! git grep -n '[	 ]$' '*.rb' '*.[chy]'
      - name: Check for header macros
        run: |
          ! for header in ruby/*.h; do \
            git grep -l -F -e $header -e HAVE_`echo $header | tr a-z./ A-Z__` -- . > /dev/null || echo $header
          done | grep -F .
        working-directory: include