From 753dbc3406f75d2c143a2c491ff4e3ac97318134 Mon Sep 17 00:00:00 2001 From: Caio Ramos Casimiro Date: Wed, 27 Mar 2024 15:36:40 +0000 Subject: [PATCH] chore(ci) add macOS jobs to Large CI Signed-off-by: Thibault Charbonnier --- .../actions/setup-httpbin-server/action.yml | 9 +++--- .github/workflows/ci-large.yml | 31 ++++++++++++++++++- .github/workflows/ci.yml | 1 - .github/workflows/job-unit-tests.yml | 28 ++++++++++++++--- .github/workflows/job-valgrind-tests.yml | 9 ++++-- 5 files changed, 65 insertions(+), 13 deletions(-) diff --git a/.github/actions/setup-httpbin-server/action.yml b/.github/actions/setup-httpbin-server/action.yml index 18ff213d1..5be5f7c10 100644 --- a/.github/actions/setup-httpbin-server/action.yml +++ b/.github/actions/setup-httpbin-server/action.yml @@ -27,16 +27,17 @@ runs: using: 'composite' steps: - name: 'Setup deps - apt-get' - if: ${{ inputs.os == 'ubuntu-latest' }} + if: ${{ contains(inputs.os, 'ubuntu') }} shell: bash run: | sudo apt-get update sudo apt-get install -y dnsmasq - - name: 'Setup deps - macos' - if: ${{ inputs.os == 'macos-latest' }} + - name: 'Setup deps - macOS' + if: ${{ contains(inputs.os, 'macos') }} shell: bash run: | - brew install dnsmasq + brew install dnsmasq docker colima + 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..9f86a921b 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,36 @@ jobs: debug: debug hup: no_hup module_type: static + # macOS - Wasmer (full) + - label: macos_wasmer_full + runtime: wasmer + wasmer: 3.1.1 + os: macos-13 + cc: clang + ngx: 1.27.0 + ssl: ssl + debug: debug + hup: no_hup + # macOS - Wasmtime + - label: macos_wasmtime + runtime: wasmtime + wasmtime: 22.0.0 + os: macos-13 + cc: clang + ngx: 1.27.0 + ssl: ssl + debug: debug + hup: hup + # macOS - V8 + - label: macos_v8 + runtime: v8 + v8: 12.0.267.17 + os: macos-13 + cc: clang + ngx: 1.27.0 + ssl: ssl + debug: debug + hup: no_hup uses: ./.github/workflows/job-unit-tests.yml with: os: ${{ matrix.os }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 687cfc00e..8ef5fbbf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,7 +182,6 @@ jobs: v8: [""] hup: [no_hup, hup] debug: [debug] - path: [""] include: # Wasmtime - runtime: wasmtime diff --git a/.github/workflows/job-unit-tests.yml b/.github/workflows/job-unit-tests.yml index 7f8f6a1ce..1c19a6336 100644 --- a/.github/workflows/job-unit-tests.yml +++ b/.github/workflows/job-unit-tests.yml @@ -76,6 +76,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 }} @@ -100,6 +103,11 @@ jobs: uses: dtolnay/rust-toolchain@stable with: target: wasm32-wasi + - name: Setup Go + if: ${{ !env.ACT }} + uses: actions/setup-go@v5 + with: + go-version: 1.22.x - name: Setup TinyGo if: ${{ !env.ACT }} uses: acifani/setup-tinygo@v2 @@ -119,6 +127,7 @@ jobs: ghcr_username: ${{ github.repository_owner }} ghcr_password: ${{ secrets.TOKEN_GITHUB }} - name: Setup coredumps location + if: ${{ contains(inputs.os, 'ubuntu') }} run: | mkdir ${{ github.workspace }}/coredumps sudo bash -c 'echo "${{ github.workspace }}/coredumps/%e.%p.%t" > /proc/sys/kernel/core_pattern' @@ -127,14 +136,23 @@ jobs: - name: Run tests run: | ulimit -c unlimited - make test + ./util/test.sh t/0* 2>&1 | tee valgrind.out - 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 +192,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* diff --git a/.github/workflows/job-valgrind-tests.yml b/.github/workflows/job-valgrind-tests.yml index 4fd23bf1e..bb91fd0e0 100644 --- a/.github/workflows/job-valgrind-tests.yml +++ b/.github/workflows/job-valgrind-tests.yml @@ -96,6 +96,11 @@ jobs: uses: dtolnay/rust-toolchain@stable with: target: wasm32-wasi + - name: Setup Go + if: ${{ !env.ACT }} + uses: actions/setup-go@v5 + with: + go-version: 1.22.x - name: Setup TinyGo if: ${{ !env.ACT }} uses: acifani/setup-tinygo@v2 @@ -118,8 +123,8 @@ jobs: - run: make - name: Run tests run: | - IN_PATH="${{ inputs.path }}" - ./util/test.sh ${IN_PATH:-t/} 2>&1 | tee valgrind.out + IN_PATH="${{ inputs.path }}" + ./util/test.sh ${IN_PATH:-t/0*} 2>&1 | tee valgrind.out - run: | awk -f ./util/parse-valgrind.awk valgrind.out > valgrind.log if [[ -s valgrind.log ]]; then