diff --git a/.github/actions/setup-httpbin-server/action.yml b/.github/actions/setup-httpbin-server/action.yml index 18ff213d1..d403dcfeb 100644 --- a/.github/actions/setup-httpbin-server/action.yml +++ b/.github/actions/setup-httpbin-server/action.yml @@ -36,7 +36,8 @@ runs: if: ${{ inputs.os == 'macos-latest' }} shell: bash run: | - brew install dnsmasq + brew install dnsmasq docker + colima start --network-address - name: Setup Docker image tag id: setup shell: bash diff --git a/.github/workflows/ci-large.yml b/.github/workflows/ci-large.yml index 85a76b6f4..ccb55ef26 100644 --- a/.github/workflows/ci-large.yml +++ b/.github/workflows/ci-large.yml @@ -22,7 +22,6 @@ jobs: matrix: label: [""] os: [ubuntu-latest] - #os: [ubuntu-latest, macos-latest] cc: [gcc-12] ngx: [1.27.0] runtime: [wasmtime, wasmer, v8] @@ -47,6 +46,35 @@ jobs: debug: debug hup: no_hup module_type: static + # macOS - Wasmer (full) + - runtime: wasmer + wasmer: 3.1.1 + os: macos-latest + cc: clang + ngx: 1.25.4 + ssl: ssl + debug: debug + hup: no_hup + # macOS - Wasmtime + - runtime: wasmtime + wasmtime: 19.0.0 + os: macos-latest + cc: clang + ngx: 1.25.4 + ssl: ssl + debug: debug + hup: hup + path: t/01-wasm + # macOS - V8 + - runtime: v8 + v8: 12.0.267.17 + os: macos-latest + cc: clang + ngx: 1.25.4 + ssl: ssl + debug: debug + hup: no_hup + path: t/01-wasm uses: ./.github/workflows/job-unit-tests.yml with: os: ${{ matrix.os }} @@ -62,6 +90,7 @@ jobs: debug: ${{ matrix.debug }} hup: ${{ matrix.hup }} module_type: ${{ matrix.module_type }} + path: ${{ matrix.path }} valgrind: name: 'Valgrind' diff --git a/.github/workflows/job-unit-tests.yml b/.github/workflows/job-unit-tests.yml index 7f8f6a1ce..6dc9cfce7 100644 --- a/.github/workflows/job-unit-tests.yml +++ b/.github/workflows/job-unit-tests.yml @@ -42,6 +42,9 @@ on: module_type: required: true type: string + path: + required: false + type: string coverage: required: false type: boolean @@ -76,6 +79,9 @@ jobs: - name: 'Setup deps - apt-get' if: ${{ contains(inputs.os, 'ubuntu') }} run: sudo apt-get update && sudo apt-get install -y ${CC} libstdc++-${CC#*-}-dev lcov + - name: 'Setup deps - macOS' + if: ${{ contains(inputs.os, 'macos') }} + run: brew install lcov - uses: actions/checkout@v4 - name: 'Setup cache - rustup toolchain' if: ${{ !env.ACT }} @@ -127,14 +133,24 @@ jobs: - name: Run tests run: | ulimit -c unlimited - make test + IN_PATH="${{ inputs.path != '' && inputs.path || 't/0*' }}" + ./util/test.sh ${IN_PATH} - name: Run lcov id: lcov if: ${{ !env.ACT && inputs.coverage }} run: | - 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 + case "$CC" in + clang*) + lcov --gcov-tool gcov --capture --directory work/buildroot --base-directory work/nginx-patched --output-file lcov.info + lcov --gcov-tool gcov --remove lcov.info "*/ngx_wasm_module/src/common/debug/*" --output-file lcov.info + lcov --gcov-tool gcov --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 + ;; + esac name="unit" if [ -n "${{ inputs.openresty }}" ]; then @@ -174,7 +190,7 @@ jobs: uses: actions/upload-artifact@v4 if: ${{ failure() && !env.ACT }} with: - name: ${{ github.job }}-sha-${{ github.sha }}-run-${{ github.run_number }}-${{ inputs.ngx != '' && format('nginx-{0}', inputs.ngx) || format('openresty-{0}', inputs.openresty) }}-${{ inputs.runtime }}-${{ inputs.module_type == 'dynamic' && 'dynamic' || 'static'}}-${{ inputs.ipc }}-${{ inputs.ssl }}-${{ inputs.debug }}-${{ inputs.hup }} + name: ${{ github.job }}-sha-${{ github.sha }}-run-${{ github.run_number }}-${{ inputs.os }}-${{ inputs.ngx != '' && format('nginx-{0}', inputs.ngx) || format('openresty-{0}', inputs.openresty) }}-${{ inputs.runtime }}-${{ inputs.module_type == 'dynamic' && 'dynamic' || 'static'}}-${{ inputs.ipc }}-${{ inputs.ssl }}-${{ inputs.debug }}-${{ inputs.hup }} path: | work/buildroot/ t/servroot*