Skip to content

Commit 5849dba

Browse files
committed
ci: Add GitHub Actions workflows
1 parent 48a2aaa commit 5849dba

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed

.github/workflows/build.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "Build"
2+
3+
on: [push]
4+
5+
jobs:
6+
# Native linux builds
7+
linux:
8+
name: 'Linux: ${{ matrix.os }}: ${{ matrix.compiler.vendor }}'
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os:
14+
- ubuntu-22.04
15+
- ubuntu-24.04
16+
compiler:
17+
# The NetSurf build system can't find LLVM AR (it looks for it
18+
# in /usr/lib instead of /usr/bin:
19+
# `make: /usr/lib/llvm-ar: No such file or directory`).
20+
# So we need to make it explicit for llvm.
21+
- { vendor: gnu, CC: gcc, AR: ar }
22+
- { vendor: llvm, CC: clang, AR: llvm-ar }
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v6
27+
with:
28+
fetch-depth: 1
29+
30+
- name: apt-get install packages
31+
run: sudo apt-get update -qq &&
32+
sudo apt-get install --no-install-recommends -y
33+
bison
34+
build-essential
35+
check
36+
clang
37+
flex
38+
git
39+
gperf
40+
llvm
41+
pkg-config
42+
43+
- name: Get env.sh
44+
run: |
45+
mkdir projects
46+
wget -O projects/env.sh https://raw.githubusercontent.com/netsurf-browser/netsurf/refs/heads/master/docs/env.sh
47+
48+
- name: Build and install project deps
49+
env:
50+
CC: ${{ matrix.compiler.CC }}
51+
AR: ${{ matrix.compiler.AR }}
52+
TARGET: ${{ github.event.repository.name }}
53+
run: |
54+
export TARGET_WORKSPACE="$(pwd)/projects"
55+
source projects/env.sh
56+
ns-clone -d -s -b ${GITHUB_REF_NAME}
57+
ns-make-libs install
58+
59+
- name: Build binding generator
60+
env:
61+
CC: ${{ matrix.compiler.CC }}
62+
AR: ${{ matrix.compiler.AR }}
63+
TARGET: ${{ github.event.repository.name }}
64+
run: |
65+
export TARGET_WORKSPACE="$(pwd)/projects"
66+
source projects/env.sh
67+
make -j"$(nproc)"
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "Static Analysis"
2+
3+
on: [push]
4+
5+
jobs:
6+
codeql:
7+
name: codeql
8+
runs-on: ubuntu-22.04
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
language: ['cpp']
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v6
18+
with:
19+
fetch-depth: 1
20+
21+
- name: apt-get install packages
22+
run: sudo apt-get update -qq &&
23+
sudo apt-get install --no-install-recommends -y
24+
bison
25+
build-essential
26+
check
27+
clang
28+
flex
29+
git
30+
gperf
31+
llvm
32+
pkg-config
33+
34+
- name: Get env.sh
35+
run: |
36+
mkdir projects
37+
wget -O projects/env.sh https://raw.githubusercontent.com/netsurf-browser/netsurf/refs/heads/master/docs/env.sh
38+
39+
- name: Build and install project deps
40+
env:
41+
TARGET: ${{ github.event.repository.name }}
42+
run: |
43+
export TARGET_WORKSPACE="$(pwd)/projects"
44+
source projects/env.sh
45+
ns-clone -d -s
46+
ns-make-libs install
47+
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@v4
50+
with:
51+
languages: ${{ matrix.language }}
52+
53+
- name: Build Library
54+
run: |
55+
export TARGET_WORKSPACE="$(pwd)/projects"
56+
source projects/env.sh
57+
make -j"$(nproc)"
58+
59+
- name: Perform CodeQL Analysis
60+
uses: github/codeql-action/analyze@v4

0 commit comments

Comments
 (0)