Skip to content

open source publish #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,101 @@
# Causes the build to default to the custom toolchain
build --incompatible_enable_cc_toolchain_resolution

# Overrides our custom toolchain and uses the system
build:system --noincompatible_enable_cc_toolchain_resolution
build:system --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN="0"
build:system --platform_suffix=system

build:clang-format-check --aspects @rules_swiftnav//clang_format:clang_format_check.bzl%clang_format_check_aspect
build:clang-format-check --@rules_swiftnav//clang_format:clang_format_config=//:clang_format_config
build:clang-format-check --output_groups=report

build:clang-tidy --aspects @rules_swiftnav//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
build:clang-tidy --output_groups=report

# Shared sanitizer configuration
common:sanitize -c dbg
common:sanitize --cxxopt=-g3
common:sanitize --copt=-g3
common:sanitize --linkopt=-g3
common:sanitize --cxxopt=-fno-omit-frame-pointer
common:sanitize --copt=-fno-omit-frame-pointer
common:sanitize --linkopt=-fno-omit-frame-pointer
common:sanitize --@rules_swiftnav//cc:enable_symbolizer=true

# Sanitizer overhead can cause some functions to become so large that
# the compiler falls back to a linear register allocator. This
# shouldn't cause a sanitizer build to fail.
common:sanitize --cxxopt=-Wno-error=disabled-optimization
common:sanitize --copt=-Wno-error=disabled-optimization
common:sanitize --linkopt=-Wno-error=disabled-optimization
# https://github.com/bazelbuild/bazel/issues/12797#issuecomment-980641064
common:sanitize --linkopt='-fsanitize-link-c++-runtime'
common:sanitize --cxxopt=-fPIC
common:sanitize --copt=-fPIC
common:sanitize --linkopt=-fPIC

# Address sanitizer
common:asan --config=sanitize
common:asan --cxxopt=-fsanitize=address
common:asan --copt=-fsanitize=address
common:asan --linkopt=-fsanitize=address
common:asan --cxxopt=-fno-optimize-sibling-calls
common:asan --copt=-fno-optimize-sibling-calls
common:asan --linkopt=-fno-optimize-sibling-calls
common:asan --platform_suffix=asan

# Undefined behavior sanitizer
common:ubsan --config=sanitize
common:ubsan --cxxopt=-fsanitize=undefined
common:ubsan --copt=-fsanitize=undefined
common:ubsan --linkopt=-fsanitize=undefined
common:ubsan --cxxopt=-fno-sanitize-recover=all
common:ubsan --copt=-fno-sanitize-recover=all
common:ubsan --linkopt=-fno-sanitize-recover=all
common:ubsan --cxxopt=-fsanitize=local-bounds
common:ubsan --copt=-fsanitize=local-bounds
common:ubsan --linkopt=-fsanitize=local-bounds
common:ubsan --@rules_swiftnav//cc:enable_rtti=true
# Unfortunately the current build setup doesn't seem to provide stack
# frame names using clang++ and llvm-symbolizer. (This was also the
# case in cmake, but the default of g++ there _did_ provide frame
# names in backtraces.)
test:ubsan --action_env="UBSAN_OPTIONS=print_stacktrace=1"
run:ubsan --action_env="UBSAN_OPTIONS=print_stacktrace=1"
# vptr sanitizer is horribly broken to the point of throwing false positives at a
# rate that suppressions or an ignore list are impractical.
common:ubsan --cxxopt=-fno-sanitize=vptr
common:ubsan --linkopt=-fno-sanitize=vptr
common:ubsan --platform_suffix=ubsan

# Dynamic memory sanitizer
#
# Warning: takes an incredible amount of space! Try testing only one
# target at a time.
common:msan --config=sanitize
common:msan --cxxopt=-fsanitize=memory
common:msan --copt=-fsanitize=memory
common:msan --linkopt=-fsanitize=memory
common:msan --cxxopt=-fsanitize-memory-track-origins=2
common:msan --copt=-fsanitize-memory-track-origins=2
common:msan --linkopt=-fsanitize-memory-track-origins=2
common:msan --cxxopt=-fsanitize-memory-use-after-dtor
common:msan --copt=-fsanitize-memory-use-after-dtor
common:msan --linkopt=-fsanitize-memory-use-after-dtor
common:msan --platform_suffix=msan

# > Currently, ThreadSanitizer symbolizes its output using an external
# > addr2line process (this will be fixed in future).
#
# https://clang.llvm.org/docs/ThreadSanitizer.html#usage
common:tsan --config=sanitize
common:tsan --cxxopt=-fsanitize=thread
common:tsan --copt=-fsanitize=thread
common:tsan --linkopt=-fsanitize=thread
common:tsan --platform_suffix=tsan

# Helpful aliases
common:asan_ubsan --config=asan
common:asan_ubsan --config=ubsan
common:ubsan_asan --config=asan_ubsan
6 changes: 6 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
11 changes: 0 additions & 11 deletions .github/workflows/auto-cancellation.yaml

This file was deleted.

109 changes: 81 additions & 28 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,31 @@ on:
pull_request:
push:
branches:
- 'master'
- 'starling-v*-release'
- 'v*-release'
- "master"
- "starling-v*-release"
- "v*-release"
tags:
- 'v*'
- 'starling-v*'
- "v*"
- "starling-v*"

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write
pull-requests: write

jobs:
ubuntu-codecov:
runs-on: ubuntu-latest
container: ubuntu:18.04
container: "ubuntu:24.04"

steps:
- name: Setup container
run: |
apt-get update
apt-get install -y gpg wget curl software-properties-common unzip git cmake build-essential clang llvm

- name: Setup container
run: |
Expand All @@ -32,7 +43,7 @@ jobs:
apt-get install -y git cmake build-essential clang llvm

- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v4.1.7
with:
fetch-depth: 0
submodules: recursive
Expand All @@ -46,10 +57,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_ORGANIZATION: swift-nav
SONAR_PROJECT_KEY: swift-nav_libswiftnav-private
SONAR_PROJECT_NAME: libswiftnav-private
SONAR_PROJECT_KEY: swift-nav_libswiftnav
SONAR_PROJECT_NAME: libswiftnav
SONAR_HOST_URL: https://sonarcloud.io
SONAR_SCANNER_VERSION: 4.2.0.1873
SONAR_SCANNER_VERSION: 5.0.1.3006

run: |
bash ./ci-build.sh
Expand All @@ -58,16 +69,18 @@ jobs:
strategy:
matrix:
include:
- {env: "MSVC", arch: "Win32"}
- {env: "MSVC", arch: "x64"}
- {env: "MinGW"}
- { env: "MSVC", arch: "Win32" }
- { env: "MSVC", arch: "x64" }
- { env: "MinGW" }

runs-on: windows-2019
runs-on: windows-latest

steps:
- name: Configure git
run: git config --global http.postBuffer 1048576000

- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive
ssh-key: ${{ secrets.SSH_KEY }}
Expand All @@ -92,7 +105,7 @@ jobs:
- name: Run build (MSVC)
if: matrix.env == 'MSVC'
env:
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_GENERATOR: "Visual Studio 17 2022"
run: |
cmake -G "$env:CMAKE_GENERATOR" -A ${{ matrix.arch }} -S . -B build;
cmake --build build --config Release;
Expand All @@ -112,20 +125,46 @@ jobs:
strategy:
matrix:
include:
- {cc: "gcc-6", cxx: "g++-6", test_suite: "unit",
package: "gcc-6 g++-6", runs_on: "ubuntu-latest", container: "ubuntu:18.04"}
- {cc: "clang-6.0", cxx: "clang++-6.0", test_suite: "lint",
package: "clang-6.0 libc++-dev libc++abi-dev clang-format-6.0 clang-tidy-6.0",
runs_on: "ubuntu-latest", container: "ubuntu:18.04"}
- {cc: "gcc-11", cxx: "g++-11", test_suite: "unit",
package: "gcc-11 g++-11", runs_on: "ubuntu-latest", container: "ubuntu:18.04"}
- {cc: "clang", cxx: "clang++", test_suite: "unit",
runs_on: "macos-11", container: ~}

- {
cc: "gcc-10",
cxx: "g++-10",
test_suite: "unit",
package: "gcc-10 g++-10",
runs_on: "ubuntu-latest",
container: "ubuntu:24.04",
}
- {
cc: "clang-14",
cxx: "clang++-14",
test_suite: "lint",
package: "clang-14 libc++-dev libc++abi-dev clang-format-14 clang-tidy-14",
runs_on: "ubuntu-latest",
container: "ubuntu:24.04",
}
- {
cc: "gcc-14",
cxx: "g++-14",
test_suite: "unit",
package: "gcc-14 g++-14",
runs_on: "ubuntu-latest",
container: "ubuntu:24.04",
}
- {
cc: "clang",
cxx: "clang++",
test_suite: "unit",
runs_on: "macos-latest",
container: ~,
}
runs-on: ${{ matrix.runs_on }}
container: ${{ matrix.container }}

steps:
- name: Setup container
if: matrix.container == 'ubuntu:24.04'
run: |
apt-get update
apt-get install -y gpg wget curl software-properties-common zip libeigen3-dev libserialport-dev git cmake build-essential ${{ matrix.package }}

- name: Setup container
if: matrix.container == 'ubuntu:18.04'
Expand All @@ -142,7 +181,7 @@ jobs:
apt-get install -y libeigen3-dev libserialport-dev git cmake build-essential ${{ matrix.package }}

- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v4.1.7
with:
submodules: recursive
ssh-key: ${{ secrets.SSH_KEY }}
Expand All @@ -155,3 +194,17 @@ jobs:
TESTENV: c
run: |
bash ./ci-build.sh

dependabot:
name: "Dependabot"
needs: [unix]
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} # Detect that the PR author is dependabot
steps:
- name: Enable auto-merge for Dependabot PRs
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "cmake/common"]
path = cmake/common
url = https://github.com/swift-nav/cmake.git
[submodule "third_party/check"]
path = third_party/check
url = https://github.com/swift-nav/check.git
[submodule "third_party/googletest"]
path = third_party/googletest
url = git@github.com:google/googletest.git
Loading
Loading