Debian Codegraph @

.github/workflows/codeql.yml

raw
1 name: "CodeQL static analysis"
2
3 on:
4 push:
5 pull_request:
6 schedule:
7 - cron: '31 3 * * 1' # Monday at 3h31 UTC
8
9 jobs:
10 skip_duplicates:
11 continue-on-error: true
12 runs-on: ubuntu-24.04
13 outputs:
14 should_skip: ${{ steps.skip_check.outputs.should_skip }}
15 steps:
16 - id: skip_check
17 uses: fkirc/skip-duplicate-actions@v5
18 with:
19 concurrent_skipping: 'same_content_newer'
20 skip_after_successful_duplicate: 'true'
21 paths_ignore: '["doc/**", "**/*.md", ".gitignore", "libxcrypt.spec.rpkg", ".packit.yaml", "rpkg.macros", "AUTHORS", "ChangeLog", "COPYING.LIB", "LICENSING", "NEWS", "README", "THANKS", "TODO"]'
22 do_not_skip: '["workflow_dispatch", "schedule"]'
23
24 CodeQL:
25 needs: skip_duplicates
26 if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}
27
28 runs-on: ubuntu-24.04
29 permissions:
30 actions: read
31 contents: read
32 security-events: write
33
34 env:
35 ac_cv_func_arc4random_buf: "no"
36
37 steps:
38 - name: Checkout repository
39 uses: actions/checkout@v4
40
41 - name: Install packages
42 run: sudo apt-get install libltdl-dev
43
44 - name: Initialize CodeQL
45 uses: github/codeql-action/init@v3
46 with:
47 # CodeQL lumps C with C++. Perl is not currently supported.
48 languages: cpp, python
49
50 # If you wish to specify custom queries, you can do so here or in a
51 # config file. By default, queries listed here will override any
52 # specified in a config file. Prefix the list here with "+" to use
53 # these queries and those in the config file.
54 #queries:
55 # - ./path/to/local/query
56 # - your-org/your-repo/queries@main
57
58 - name: Versions of build tools
59 id: build-tools
60 run: ./build-aux/ci/ci-log-dependency-versions
61
62 - name: Get nprocs
63 run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV
64
65 - name: Cache bootstrap
66 id: cache
67 uses: actions/cache@v4
68 with:
69 path: |
70 INSTALL
71 Makefile.in
72 aclocal.m4
73 config.h.in
74 configure
75 autom4te.cache/**
76 build-aux/m4/libtool.m4
77 build-aux/m4/ltoptions.m4
78 build-aux/m4/ltsugar.m4
79 build-aux/m4/ltversion.m4
80 build-aux/m4/lt~obsolete.m4
81 build-aux/m4-autogen/**
82 key: autoreconf-${{ steps.build-tools.outputs.autotools-ver }}-${{ hashFiles('autogen.sh', 'configure.ac', 'Makefile.am', 'build-aux/m4/*.m4', 'build-aux/m4-autogen/**') }}
83
84 - name: Bootstrap
85 if: steps.cache.outputs.cache-hit != 'true'
86 run: ./autogen.sh
87
88 - name: Configure
89 run: ./configure --enable-obsolete-api --enable-hashes=all
90
91 - name: Build
92 run: |
93 make -j${{ env.NPROCS }} all
94 make -j${{ env.NPROCS }} test-programs
95
96 - name: Perform CodeQL Analysis
97 uses: github/codeql-action/analyze@v3
98
99 - name: Detailed error logs
100 if: failure()
101 run: ./build-aux/ci/ci-log-logfiles