|
| 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 |
0 commit comments