Skip to content

Commit

Permalink
chore(ci) bump and sync CC version among Dockerfiles and CI workflows
Browse files Browse the repository at this point in the history
Dockerfiles and CI workflow use the latest version available in the
runner OS.

Older versions of gcc and clang are tested in CI Large.

Also fix minor issues reported by the newer clang-analyzer.
  • Loading branch information
casimiro committed Sep 11, 2023
1 parent 6b17917 commit bc6b5ce
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 59 deletions.
46 changes: 41 additions & 5 deletions .github/workflows/ci-large.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
label: [""]
os: [ubuntu-latest]
#os: [ubuntu-latest, macos-latest]
cc: [gcc-9]
cc: [gcc-12]
ngx: [1.25.2]
runtime: [wasmtime, wasmer, v8]
wasmtime: [12.0.1]
Expand All @@ -35,7 +35,7 @@ jobs:
# OpenResty + static ngx_wasm_module
- label: dynamic_module
os: ubuntu-latest
cc: gcc-9
cc: gcc-12
openresty: 1.21.4.2
runtime: wasmtime
wasmtime: 12.0.1
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-22.04]
cc: [gcc-10]
cc: [gcc-12]
ngx: [1.25.2]
runtime: [wasmer, wasmtime, v8]
wasmtime: [12.0.1]
Expand All @@ -77,7 +77,7 @@ jobs:
# OpenResty
- label: openresty
os: ubuntu-22.04
cc: gcc-10
cc: gcc-12
openresty: 1.21.4.2
runtime: wasmer
wasmer: 3.1.1
Expand All @@ -103,7 +103,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
cc: [clang-11]
cc: [clang-15]
openresty: [1.21.4.2]
runtime: [wasmtime, wasmer, v8]
wasmtime: [12.0.1]
Expand All @@ -122,3 +122,39 @@ jobs:
v8: ${{ matrix.v8 }}
ssl: ${{ matrix.ssl }}
debug: ${{ matrix.debug }}

build-large:
name: 'Build'
#if: ${{ false }}
strategy:
fail-fast: false
matrix:
label: [""]
os: [ubuntu-latest]
cc: [clang-14, clang-15, gcc-11, gcc-12]
ngx: [1.25.2]
runtime: [wasmtime, wasmer, v8]
wasmtime: [12.0.1]
wasmer: [3.1.1]
v8: [11.4.183.23]
ssl: [ssl]
debug: [debug]
include:
- label: old_nginx
os: [ubuntu-latest]
cc: clang-15
ngx: 1.21.6
runtime: wasmtime
wasmtime: 12.0.1
uses: ./.github/workflows/job-build-tests.yml
with:
os: ${{ matrix.os }}
cc: ${{ matrix.cc }}
ngx: ${{ matrix.ngx }}
openresty: ${{ matrix.openresty }}
runtime: ${{ matrix.runtime }}
wasmtime: ${{ matrix.wasmtime }}
wasmer: ${{ matrix.wasmer }}
v8: ${{ matrix.v8 }}
ssl: ${{ matrix.ssl }}
debug: ${{ matrix.debug }}
70 changes: 29 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
matrix:
label: [""]
os: [ubuntu-latest]
cc: [gcc-9]
cc: [gcc-12]
ngx: [1.25.2]
openresty: [""]
runtime: [wasmer]
Expand All @@ -44,7 +44,7 @@ jobs:
- runtime: wasmtime
wasmtime: 12.0.1
os: ubuntu-latest
cc: gcc-9
cc: gcc-12
ngx: 1.25.2
ssl: ssl
debug: debug
Expand All @@ -53,15 +53,15 @@ jobs:
- runtime: v8
v8: 11.4.183.23
os: ubuntu-latest
cc: gcc-9
cc: gcc-12
ngx: 1.25.2
ssl: ssl
debug: debug
hup: no_hup
# Old Nginx
- label: old_nginx
os: ubuntu-latest
cc: gcc-9
cc: gcc-12
ngx: 1.21.6
runtime: wasmer
wasmer: 3.1.1
Expand All @@ -71,7 +71,7 @@ jobs:
# Nginx + dynamic ngx_wasm_module + HUP
- label: dynamic_nginx
os: ubuntu-latest
cc: gcc-9
cc: gcc-12
ngx: 1.25.2
runtime: wasmtime
wasmtime: 12.0.1
Expand All @@ -81,7 +81,7 @@ jobs:
module_type: dynamic
# No SSL
- os: ubuntu-latest
cc: gcc-9
cc: gcc-12
ngx: 1.25.2
runtime: wasmer
wasmer: 3.1.1
Expand All @@ -91,7 +91,7 @@ jobs:
# OpenResty
- label: openresty
os: ubuntu-latest
cc: gcc-9
cc: gcc-12
openresty: 1.21.4.2
runtime: wasmtime
wasmtime: 12.0.1
Expand All @@ -101,7 +101,7 @@ jobs:
# OpenResty + dynamic ngx_wasm_module
- label: dynamic_openresty
os: ubuntu-latest
cc: gcc-9
cc: gcc-12
openresty: 1.21.4.2
runtime: wasmtime
wasmtime: 12.0.1
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
matrix:
label: [""]
os: [ubuntu-22.04]
cc: [gcc-10]
cc: [gcc-12]
ngx: [1.25.2]
openresty: [""]
runtime: [wasmer]
Expand All @@ -161,22 +161,22 @@ jobs:
- runtime: wasmtime
wasmtime: 12.0.1
os: ubuntu-22.04
cc: gcc-10
cc: gcc-12
ngx: 1.25.2
hup: no_hup
debug: debug
# V8
- runtime: v8
v8: 11.4.183.23
os: ubuntu-22.04
cc: gcc-10
cc: gcc-12
ngx: 1.25.2
debug: debug
hup: no_hup
# OpenResty
- label: openresty
os: ubuntu-22.04
cc: gcc-10
cc: gcc-12
openresty: 1.21.4.2
ngx:
runtime: wasmer
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
strategy:
fail-fast: false
matrix:
cc: [clang-11]
cc: [clang-15]
openresty: [1.21.4.2]
runtime: [wasmtime, wasmer, v8]
wasmtime: [12.0.1]
Expand All @@ -251,7 +251,7 @@ jobs:
include:
# No SSL
- os: ubuntu-latest
cc: clang-11
cc: clang-15
ngx: 1.25.2
runtime: wasmer
wasmer: 3.1.1
Expand All @@ -272,39 +272,27 @@ jobs:
build:
name: 'Build'
#if: ${{ false }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
label: [""]
os: [ubuntu-latest]
cc: [clang-14, gcc-10]
cc: [clang-15, gcc-12]
ngx: [1.25.2]
runtime: [wasmtime, wasmer, v8]
wasmtime: [12.0.1]
wasmer: [3.1.1]
v8: [11.4.183.23]
include:
- label: old_nginx
os: ubuntu-latest
cc: clang-14
ngx: 1.21.6
runtime: wasmtime
wasmtime: 12.0.1
steps:
- uses: actions/checkout@v3
- name: 'Setup cache - work/ dir'
uses: actions/cache@v3
if: ${{ !env.ACT }}
with:
path: |
work/downloads
work/runtimes
work/openssl
key: work-${{ runner.os }}-${{ matrix.cc }}-${{ matrix.ngx }}-${{ matrix.openresty }}-${{ matrix.runtime }}-${{ hashFiles('util/**/*.sh', 'util/**/*.pl', 'util/**/*.awk', '.github/**/*.yml', '.github/**/*.sh', '.github/**/*.js', 'rust-toolchain', 'Makefile') }}
- name: Setup Wasm runtime
run: ./util/runtime.sh -R ${{ matrix.runtime }} -V ${{ matrix[matrix.runtime] }}
- run: make setup
- run: make test-build
env:
NGX_WASM_RUNTIME: ${{ matrix.runtime }}
ssl: [ssl]
debug: [debug]
uses: ./.github/workflows/job-build-tests.yml
with:
os: ${{ matrix.os }}
cc: ${{ matrix.cc }}
ngx: ${{ matrix.ngx }}
openresty: ${{ matrix.openresty }}
runtime: ${{ matrix.runtime }}
wasmtime: ${{ matrix.wasmtime }}
wasmer: ${{ matrix.wasmer }}
v8: ${{ matrix.v8 }}
ssl: ${{ matrix.ssl }}
debug: ${{ matrix.debug }}
75 changes: 75 additions & 0 deletions .github/workflows/job-build-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build tests

on:
workflow_call:
inputs:
os:
required: true
type: string
cc:
required: true
type: string
ngx:
required: true
type: string
openresty:
required: true
type: string
runtime:
required: true
type: string
wasmtime:
required: true
type: string
wasmer:
required: true
type: string
v8:
required: true
type: string
debug:
required: true
type: string
ssl:
required: true
type: string

defaults:
run:
shell: bash

env:
CC: ${{ inputs.cc }}
NGX_BUILD_OPENRESTY: ${{ inputs.openresty }}
NGX_WASM_RUNTIME: ${{ inputs.runtime }}
NGX_BUILD_DEBUG: ${{ inputs.debug == 'debug' && 1 || 0 }}
NGX_BUILD_SSL: ${{ inputs.ssl == 'ssl' && 1 || 0 }}

jobs:
build:
name: 'Build'
#if: ${{ false }}
runs-on: ${{ inputs.os }}
steps:
- name: 'Setup deps - apt-get gcc'
if: ${{ !env.ACT && contains(inputs.cc, 'gcc') }}
run: sudo apt-get update && sudo apt-get install -y ${CC} libstdc++-${CC#*-}-dev lcov

- name: 'Setup deps - apt-get clang'
if: ${{ !env.ACT && contains(inputs.cc, 'clang') }}
run: sudo apt-get update && sudo apt-get install -y ${CC} lcov

- uses: actions/checkout@v3
- name: 'Setup cache - work/ dir'
uses: actions/cache@v3
if: ${{ !env.ACT }}
with:
path: |
work/downloads
work/runtimes
work/openssl
key: work-${{ runner.os }}-${{ inputs.cc }}-${{ inputs.ngx }}-${{ inputs.openresty }}-${{ inputs.runtime }}-${{ hashFiles('util/**/*.sh', 'util/**/*.pl', 'util/**/*.awk', '.github/**/*.yml', '.github/**/*.sh', '.github/**/*.js', 'rust-toolchain', 'Makefile') }}
- name: Setup Wasm runtime
run: ./util/runtime.sh -R ${{ inputs.runtime }} -V ${{ inputs[inputs.runtime] }}
- run: make setup
- run: make test-build
14 changes: 7 additions & 7 deletions .github/workflows/job-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ jobs:
coveralls_name: ${{ steps.lcov.outputs.name }}
steps:
- name: 'Setup deps - apt-get'
if: ${{ inputs.cc == 'gcc-9' }}
run: sudo apt-get update && sudo apt-get install -y gcc-9 libstdc++-9-dev lcov
if: ${{ !env.ACT }}
run: sudo apt-get update && sudo apt-get install -y ${CC} libstdc++-${CC#*-}-dev lcov
- uses: actions/checkout@v3
- name: 'Setup cache - rustup toolchain'
if: ${{ !env.ACT }}
Expand Down Expand Up @@ -116,11 +116,11 @@ jobs:
- run: make test
- name: Run lcov
id: lcov
if: ${{ !env.ACT && inputs.cc == 'gcc-9' && inputs.coverage }}
if: ${{ !env.ACT && inputs.coverage }}
run: |
lcov --capture --directory work/buildroot --output-file lcov.info
lcov --remove lcov.info "*/ngx_wasm_module/src/common/debug/*" --output-file lcov.info
lcov --extract lcov.info "*/ngx_wasm_module/src/*" --output-file lcov.info
lcov --gcov-tool gcov-${CC#*-} --capture --directory work/buildroot --output-file lcov.info
lcov --gcov-tool gcov-${CC#*-} --remove lcov.info "*/ngx_wasm_module/src/common/debug/*" --output-file lcov.info
lcov --gcov-tool gcov-${CC#*-} --extract lcov.info "*/ngx_wasm_module/src/*" --output-file lcov.info
name="unit"
if [ -n "${{ inputs.openresty }}" ]; then
Expand All @@ -139,7 +139,7 @@ jobs:
fi
echo "name=$name" >> $GITHUB_OUTPUT
- name: Coveralls Upload
if: ${{ !env.ACT && inputs.cc == 'gcc-9' && inputs.coverage }}
if: ${{ !env.ACT && inputs.coverage }}
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading

0 comments on commit bc6b5ce

Please sign in to comment.