Skip to content

Commit c24d29a

Browse files
committed
ci: Add github workflows
1 parent 728548e commit c24d29a

File tree

2 files changed

+137
-0
lines changed

2 files changed

+137
-0
lines changed

.github/workflows/build.yaml

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

0 commit comments

Comments
 (0)