Skip to content
Merged
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
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ci
on:
push:
branches:
- master
pull_request:
workflow_dispatch:

defaults:
run:
shell: bash

# Cancels a previous run if a new commit is made on the same pull request
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true


jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Bazel
uses: bazel-contrib/setup-bazel@0.14.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Bazel tests
run: bazel test src:all
6 changes: 6 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,9 @@ git_repository(
remote = "https://github.com/nlohmann/json.git",
shallow_since = "1701207391 +0100",
)

http_archive(
name = "platforms",
urls = ["https://github.com/bazelbuild/platforms/archive/refs/tags/0.0.6.zip"],
strip_prefix = "platforms-0.0.6",
)
12 changes: 9 additions & 3 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ OPT_COPTS = select({
"-fno-fast-math",
"-flto",
"-march=native",
"-mmacosx-version-min=10.15"
],
":debug": ["-Og"],
}) + ["-std=c++20"]
}) + select({
"@platforms//os:windows": ["/std:c++20"],
"//conditions:default": ["-std=c++20"],
}) + select({
"@platforms//os:macos": ["-mmacosx-version-min=10.15"],
"//conditions:default": [],
})

OPT_LINKOPTS = select({
"//conditions:default": [
Expand Down Expand Up @@ -100,7 +105,8 @@ cc_test(
name = "tesseract_tests",
timeout = "eternal",
srcs = ["tesseract.test.cc"],
tags = ["exclusive"],
copts = OPT_COPTS,
linkopts = OPT_LINKOPTS,
deps = [
":libsimplex",
":libtesseract",
Expand Down
2 changes: 1 addition & 1 deletion src/tesseract.test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bool simplex_test_compare(stim::DetectorErrorModel& dem,

TEST(tesseract, Tesseract_simplex_test) {
for (float p_err : {0.001, 0.003, 0.005}) {
for (size_t distance : {3, 5, 7}) {
for (size_t distance : {3, 5}) {
for (const size_t num_rounds : {2, 5, 10}) {
const size_t num_shots = 1000 / num_rounds / distance;
std::cout << "p_err = " << p_err << " distance = " << distance
Expand Down