diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 81cf87de8..cfc827b44 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -11,7 +11,7 @@ env: jobs: build: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index 3bf30cb02..a9b9a16b2 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -9,7 +9,7 @@ on: jobs: formatting-check: name: Formatting Check - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest strategy: matrix: path: diff --git a/.github/workflows/cmake_examples.yml b/.github/workflows/cmake_examples.yml index 3e3352ae6..fe6c32780 100644 --- a/.github/workflows/cmake_examples.yml +++ b/.github/workflows/cmake_examples.yml @@ -11,7 +11,11 @@ env: jobs: build: - runs-on: ubuntu-24.04 + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -23,7 +27,7 @@ jobs: - name: Build working-directory: ${{github.workspace}}/examples run: cmake --build build - + - name: Stalingrado working-directory: ${{github.workspace}}/examples run: make stalingrado diff --git a/.github/workflows/cmake_install.yml b/.github/workflows/cmake_install.yml index 27d448e99..2f774e262 100644 --- a/.github/workflows/cmake_install.yml +++ b/.github/workflows/cmake_install.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/cmake_test.yml b/.github/workflows/cmake_test.yml index 3443e660a..bd015e20c 100644 --- a/.github/workflows/cmake_test.yml +++ b/.github/workflows/cmake_test.yml @@ -11,7 +11,7 @@ env: jobs: build: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Update apt repo diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index b765044ae..c4fcad627 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -32,7 +32,7 @@ jobs: security-events: write # for github/codeql-action/upload-sarif to upload SARIF results actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status name: Codacy Security Scan - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: # Checkout the repository to the GitHub Actions runner - name: Checkout code diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6e2489bc7..26a731fc8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,7 +17,7 @@ jobs: # - https://gh.io/supported-runners-and-hardware-resources # - https://gh.io/using-larger-runners # Consider using larger runners for possible analysis time improvements. - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-24.04' }} + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} permissions: actions: read diff --git a/.github/workflows/flawfinder.yml b/.github/workflows/flawfinder.yml index a6d48b39e..8d7ba081f 100644 --- a/.github/workflows/flawfinder.yml +++ b/.github/workflows/flawfinder.yml @@ -17,7 +17,7 @@ on: jobs: flawfinder: name: Flawfinder - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest permissions: actions: read contents: read diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 20887681d..e23ba6471 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -8,7 +8,7 @@ on: jobs: build-and-deploy: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/profile_exec_time.yml b/.github/workflows/profile_exec_time.yml index 99a115efd..631b3c606 100644 --- a/.github/workflows/profile_exec_time.yml +++ b/.github/workflows/profile_exec_time.yml @@ -11,7 +11,7 @@ env: jobs: build: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/profile_mem_usage.yml b/.github/workflows/profile_mem_usage.yml index 65ca0709e..63e5aaae7 100644 --- a/.github/workflows/profile_mem_usage.yml +++ b/.github/workflows/profile_mem_usage.yml @@ -11,7 +11,7 @@ env: jobs: build: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 9e23b2930..caba9d8a5 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python 3.10 diff --git a/examples/slow_charge_rb.cpp b/examples/slow_charge_rb.cpp index 48445119d..dc1fa734a 100644 --- a/examples/slow_charge_rb.cpp +++ b/examples/slow_charge_rb.cpp @@ -14,6 +14,11 @@ namespace fs = std::filesystem; #include +#ifdef __APPLE__ +#define thread_t std::thread +#else +#define thread_t std::jthread +#endif #include std::atomic progress{0}; @@ -183,7 +188,7 @@ int main(int argc, char** argv) { // std::vector deltas; // lauch progress bar - std::jthread t([]() { + thread_t t([]() { while (progress < MAX_TIME && !bExitFlag) { printLoadingBar(progress, MAX_TIME); std::this_thread::sleep_for(std::chrono::milliseconds(1500)); @@ -299,5 +304,9 @@ int main(int argc, char** argv) { std::cout << '\n'; std::cout << "Done." << std::endl; +#ifdef __APPLE__ + t.join(); +#endif + return 0; } diff --git a/examples/slow_charge_tl.cpp b/examples/slow_charge_tl.cpp index 5a7d91860..2d71f5544 100644 --- a/examples/slow_charge_tl.cpp +++ b/examples/slow_charge_tl.cpp @@ -14,6 +14,11 @@ namespace fs = std::filesystem; #include +#ifdef __APPLE__ +#define thread_t std::thread +#else +#define thread_t std::jthread +#endif #include std::atomic progress{0}; @@ -287,7 +292,7 @@ int main(int argc, char** argv) { // std::vector deltas; // lauch progress bar - std::jthread t([]() { + thread_t t([]() { while (progress < MAX_TIME && !bExitFlag) { printLoadingBar(progress, MAX_TIME); std::this_thread::sleep_for(std::chrono::milliseconds(1500)); @@ -447,5 +452,9 @@ int main(int argc, char** argv) { std::cout << '\n'; std::cout << "Done." << std::endl; +#ifdef __APPLE__ + t.join(); +#endif + return 0; } diff --git a/examples/stalingrado.cpp b/examples/stalingrado.cpp index 62f7ccc8b..d0d6488ca 100644 --- a/examples/stalingrado.cpp +++ b/examples/stalingrado.cpp @@ -12,6 +12,11 @@ #include #include +#ifdef __APPLE__ +#define thread_t std::thread +#else +#define thread_t std::jthread +#endif #include std::atomic progress{0}; @@ -88,7 +93,7 @@ int main() { dynamics.updatePaths(); // lauch progress bar - std::jthread t([MAX_TIME]() { + thread_t t([MAX_TIME]() { while (progress < MAX_TIME) { printLoadingBar(progress, MAX_TIME); std::this_thread::sleep_for(std::chrono::milliseconds(1500)); @@ -113,5 +118,9 @@ int main() { ++progress; } +#ifdef __APPLE__ + t.join(); +#endif + return 0; }