xref: /curl/.github/workflows/checksrc.yml (revision 1b844967)
1# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
2#
3# SPDX-License-Identifier: curl
4
5# This workflow contains checks at the source code level only.
6
7name: Source
8
9'on':
10  push:
11    branches:
12      - master
13      - '*/ci'
14    paths-ignore:
15      - '**/*.md'
16      - '.circleci/**'
17      - 'appveyor.*'
18      - 'plan9/**'
19      - 'tests/data/**'
20      - 'winbuild/**'
21  pull_request:
22    branches:
23      - master
24    paths-ignore:
25      - '**/*.md'
26      - '.circleci/**'
27      - 'appveyor.*'
28      - 'plan9/**'
29      - 'tests/data/**'
30      - 'winbuild/**'
31
32permissions: {}
33
34jobs:
35  checksrc:
36    runs-on: ubuntu-latest
37    steps:
38      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
39        name: checkout
40
41      - name: check
42        run: git ls-files -z "*.[ch]" | xargs -0 -n1 ./scripts/checksrc.pl
43
44  codespell-cmakelint:
45    runs-on: ubuntu-latest
46    steps:
47      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
48        name: checkout
49
50      - name: install
51        run: |
52          sudo apt-get install codespell python3-pip
53          python3 -m pip install cmakelint==1.4.3
54
55      - name: spellcheck
56        run: codespell --skip src/tool_hugehelp.c -I .github/scripts/codespell-ignore.txt include src lib
57
58      - name: cmakelint
59        run: scripts/cmakelint.sh
60
61  reuse:
62    runs-on: ubuntu-latest
63    steps:
64      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
65        name: checkout
66
67      - name: REUSE Compliance Check
68        uses: fsfe/reuse-action@3ae3c6bdf1257ab19397fab11fd3312144692083 # v4
69
70  miscchecks:
71    runs-on: ubuntu-latest
72    timeout-minutes: 5
73    steps:
74      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
75        name: checkout
76
77      - name: shellcheck
78        run: .github/scripts/shellcheck.sh
79
80      - name: spacecheck
81        run: .github/scripts/spacecheck.pl
82
83      - name: yamlcheck
84        run: .github/scripts/yamlcheck.sh
85
86      - name: binarycheck
87        run: .github/scripts/binarycheck.pl
88
89      # we allow some extra in source code
90      - name: badwords
91        run: >
92          grep -Ev '(\\bwill| url | dir )' .github/scripts/badwords.txt |
93          .github/scripts/badwords.pl `git ls-files -- src lib include`
94