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
76 changes: 76 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: "Linux Build"

on: [push]

jobs:
linux:
name: '${{ 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@v3
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
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
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
61 changes: 61 additions & 0 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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
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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
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@v3
Loading