Skip to content

Commit

Permalink
Add portable uBPF unit tests that run on Windows / Linux / MacOS (#119)
Browse files Browse the repository at this point in the history
* Add tests using bpf_conformance library

Signed-off-by: Alan Jowett <alanjo@microsoft.com>

* Add arm64 sanitizer pass

Signed-off-by: Alan Jowett <alanjo@microsoft.com>

* Limit macOS to aligned load/store

Signed-off-by: Alan Jowett <alanjo@microsoft.com>

* Add option to debug ASAN failures

Signed-off-by: Alan Jowett <alanjo@microsoft.com>

* Disable ubsan until we can resolve the issues

Signed-off-by: Alan Jowett <alanjo@microsoft.com>

* Remove dead code

Signed-off-by: Alan Jowett <alanjo@microsoft.com>

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
  • Loading branch information
Alan-Jowett committed Oct 13, 2022
1 parent e1fcba4 commit 6bd288b
Show file tree
Hide file tree
Showing 21 changed files with 606 additions and 100 deletions.
129 changes: 76 additions & 53 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,155 +32,178 @@ jobs:
windows_release:
uses: ./.github/workflows/windows.yml
with:
platform: windows-latest
platform: windows-2019
build_type: RelWithDebInfo
upload_packages: true

windows_debug:
uses: ./.github/workflows/windows.yml
with:
platform: windows-latest
platform: windows-2019
build_type: Debug
upload_packages: true

macos_release:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: macos-11
build_type: RelWithDebInfo
enable_sanitizers: false
enable_coverage: false
scan_build: false
upload_packages: true

macos_release_coverage:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: macos-11
build_type: RelWithDebInfo
enable_sanitizers: false
enable_coverage: true
scan_build: false
upload_packages: false

macos_release_sanitizers:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: macos-11
build_type: RelWithDebInfo
enable_sanitizers: true
enable_coverage: false
scan_build: false
upload_packages: false

macos_debug:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: macos-11
build_type: Debug
enable_sanitizers: false
enable_coverage: false
scan_build: false
upload_packages: false

macos_debug_coverage:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: macos-11
build_type: Debug
enable_sanitizers: false
enable_coverage: true
scan_build: false
upload_packages: false

macos_debug_sanitizers:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: macos-11
build_type: Debug
enable_sanitizers: true
enable_coverage: false
scan_build: false
upload_packages: false

linux_release:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: ubuntu-20.04
build_type: RelWithDebInfo
enable_sanitizers: false
enable_coverage: false
scan_build: false
upload_packages: true

linux_release_arm64:
uses: ./.github/workflows/posix.yml
with:
arch: arm64
platform: ubuntu-20.04
build_type: RelWithDebInfo

linux_release_scan_build:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: ubuntu-20.04
build_type: RelWithDebInfo
enable_sanitizers: false
enable_coverage: false
scan_build: true
upload_packages: false

linux_release_coverage:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: ubuntu-20.04
build_type: RelWithDebInfo
enable_coverage: true

linux_arm64_release_coverage:
uses: ./.github/workflows/posix.yml
with:
arch: arm64
platform: ubuntu-20.04
build_type: RelWithDebInfo
enable_sanitizers: false
enable_coverage: true
scan_build: false
upload_packages: false

linux_release_sanitizers:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: ubuntu-20.04
build_type: RelWithDebInfo
enable_sanitizers: true
enable_coverage: false
scan_build: false
upload_packages: false

# Disabled until https://github.com/iovisor/ubpf/issues/155 is resolved.
# linux_release_arm64_sanitizers:
# uses: ./.github/workflows/posix.yml
# with:
# arch: arm64
# platform: ubuntu-20.04
# build_type: RelWithDebInfo
# enable_sanitizers: true

linux_debug:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: ubuntu-20.04
build_type: Debug
enable_sanitizers: false
enable_coverage: false
scan_build: false
upload_packages: false

linux_debug_arm64:
uses: ./.github/workflows/posix.yml
with:
arch: arm64
platform: ubuntu-20.04
build_type: Debug
upload_packages: true

linux_debug_coverage:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: ubuntu-20.04
build_type: Debug
enable_sanitizers: false
enable_coverage: true
scan_build: false
upload_packages: false

linux_debug_sanitizers:
linux_debug_arm64_coverage:
uses: ./.github/workflows/posix.yml
with:
arch: arm64
platform: ubuntu-20.04
build_type: Debug
enable_sanitizers: true
enable_coverage: false
scan_build: false
upload_packages: false
enable_coverage: true

linux_release_codeql:
if: github.event_name == 'schedule'
linux_debug_sanitizers:
uses: ./.github/workflows/posix.yml
with:
arch: x86_64
platform: ubuntu-20.04
build_type: RelWithDebInfo
enable_sanitizers: false
enable_coverage: false
scan_build: false
upload_packages: false
build_codeql: true
build_type: Debug
enable_sanitizers: true

# Disabled until https://github.com/iovisor/ubpf/issues/155 is resolved.
# linux_debug_arm64_sanitizers:
# uses: ./.github/workflows/posix.yml
# with:
# arch: arm64
# platform: ubuntu-20.04
# build_type: Debug
# enable_sanitizers: true

finish:
needs:
- macos_release_coverage
- macos_debug_coverage
- linux_release_coverage
- linux_debug_coverage
runs-on: ubuntu-20.04
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
Loading

0 comments on commit 6bd288b

Please sign in to comment.