Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: "Build"

on: [push]

jobs:
# Native linux builds
linux:
name: 'Linux: ${{ matrix.os }}: ${{ matrix.compiler.vendor }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
compiler:
# The NetSurf build system can't find LLVM AR (it looks for it
# in /usr/lib instead of /usr/bin:
# `make: /usr/lib/llvm-ar: No such file or directory`).
# So we need to make it explicit for llvm.
- { vendor: gnu, CC: gcc, AR: ar }
- { vendor: llvm, CC: clang, AR: llvm-ar }

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1

- name: apt-get install packages
run: sudo apt-get update -qq &&
sudo apt-get install --no-install-recommends -y
bison
build-essential
check
clang
flex
git
gperf
libsdl1.2-dev
libvncserver-dev
libwayland-dev
llvm
pkg-config

- name: Get env.sh
run: |
mkdir projects
wget -O projects/env.sh https://raw.githubusercontent.com/netsurf-browser/netsurf/refs/heads/master/docs/env.sh

- name: Build and install project deps
env:
CC: ${{ matrix.compiler.CC }}
AR: ${{ matrix.compiler.AR }}
TARGET: ${{ github.event.repository.name }}
run: |
export TARGET_WORKSPACE="$(pwd)/projects"
source projects/env.sh
ns-clone -d -s -b ${GITHUB_REF_NAME}
ns-make-libs install

- name: Build Library
env:
CC: ${{ matrix.compiler.CC }}
AR: ${{ matrix.compiler.AR }}
TARGET: ${{ github.event.repository.name }}
run: |
export TARGET_WORKSPACE="$(pwd)/projects"
source projects/env.sh
make -j"$(nproc)"

- name: Unit Tests
env:
CC: ${{ matrix.compiler.CC }}
AR: ${{ matrix.compiler.AR }}
TARGET: ${{ github.event.repository.name }}
run: |
export TARGET_WORKSPACE="$(pwd)/projects"
source projects/env.sh
make test
63 changes: 63 additions & 0 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Static Analysis"

on: [push]

jobs:
codeql:
name: codeql
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
language: ['cpp']

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: apt-get install packages
run: sudo apt-get update -qq &&
sudo apt-get install --no-install-recommends -y
bison
build-essential
check
clang
flex
git
gperf
libsdl1.2-dev
libvncserver-dev
libwayland-dev
llvm
pkg-config

- name: Get env.sh
run: |
mkdir projects
wget -O projects/env.sh https://raw.githubusercontent.com/netsurf-browser/netsurf/refs/heads/master/docs/env.sh

- name: Build and install project deps
env:
TARGET: ${{ github.event.repository.name }}
run: |
export TARGET_WORKSPACE="$(pwd)/projects"
source projects/env.sh
ns-clone -d -s
ns-make-libs install

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}

- name: Build Library
run: |
export TARGET_WORKSPACE="$(pwd)/projects"
source projects/env.sh
make -j"$(nproc)"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4