Skip to content

Commit f27fc8a

Browse files
authored
Add GitHub Actions workflows for build, test, and CodeQL analysis (#87)
1 parent d5a3e0f commit f27fc8a

2 files changed

Lines changed: 84 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- '**'
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-linux-run-tests:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v6
19+
- name: show Ubuntu version
20+
run: cat /etc/os-release | grep PRETTY_NAME | awk -F '=' '{print $2}'
21+
- name: update build environment
22+
run: sudo apt-get update --fix-missing -y
23+
- name: install prerequisites
24+
run: |
25+
sudo apt-get install -y autoconf autopoint libglib2.0-dev libdbus-1-dev libtool
26+
- name: configure
27+
env:
28+
CC: /usr/bin/gcc
29+
run: ./autogen.sh && ./configure
30+
- name: make
31+
run: make
32+
- name: Run Tests
33+
run: make check || cat test/error_log*

.github/workflows/codeql.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
schedule:
9+
- cron: '0 7 * * 6'
10+
workflow_dispatch:
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
permissions:
17+
actions: read
18+
contents: read
19+
security-events: write
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: ['c']
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v6
29+
with:
30+
submodules: recursive
31+
32+
- name: Update build environment
33+
run: sudo apt-get update --fix-missing -y
34+
35+
- name: Install prerequisite
36+
run: |
37+
sudo apt-get install -y autoconf autopoint libglib2.0-dev libdbus-1-dev libtool
38+
39+
- name: Initialize CodeQL
40+
uses: github/codeql-action/init@v4
41+
with:
42+
languages: ${{ matrix.language }}
43+
queries: +security-and-quality
44+
45+
- name: Autobuild
46+
uses: github/codeql-action/autobuild@v4
47+
48+
- name: Perform CodeQL Analysis
49+
uses: github/codeql-action/analyze@v4
50+
with:
51+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)