Skip to content

Commit

Permalink
chore(ci) add macOS jobs to Large CI
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Charbonnier <[email protected]>
  • Loading branch information
casimiro authored and thibaultcha committed Jul 2, 2024
1 parent 4ffe03d commit 753dbc3
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 13 deletions.
9 changes: 5 additions & 4 deletions .github/actions/setup-httpbin-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 30 additions & 1 deletion .github/workflows/ci-large.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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 }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ jobs:
v8: [""]
hup: [no_hup, hup]
debug: [debug]
path: [""]
include:
# Wasmtime
- runtime: wasmtime
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/job-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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*
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/job-valgrind-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 753dbc3

Please sign in to comment.