Skip to content

Commit

Permalink
Trying to fix CI failures (#530)
Browse files Browse the repository at this point in the history
* Trying to fix CI failures

* MacOS Examples: Xcode 15.2

* Trying a different way to upload codecov reports

* One more time

* Don't upload coverage for tests that run without coverage
  • Loading branch information
jatinchowdhury18 authored Apr 27, 2024
1 parent 9941e87 commit d2c5b42
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false # show all errors for each platform (vs. cancel jobs on error)
matrix:
os: [ubuntu-latest, windows-2019, macos-latest]
os: [ubuntu-latest, windows-2022, macos-14]

steps:
- name: Install Linux Deps
Expand All @@ -29,6 +29,12 @@ jobs:
sudo apt-get update
sudo apt install libasound2-dev libcurl4-openssl-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev libsamplerate-dev
- name: Set Xcode version
if: runner.os == 'MacOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.2'

- name: Get latest CMake
uses: lukka/get-cmake@latest

Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ jobs:
shell: bash
run: lcov --list coverage.info

- name: Upload Coverage Data
- name: Upload coverage to Codecov
if: matrix.run_coverage
working-directory: ${{env.WORK_DIR}}
shell: bash
run: bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{env.WORK_DIR}}/coverage.info
verbose: true
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include(CPM)
CPMAddPackage(
NAME juce
GITHUB_REPOSITORY juce-framework/juce
GIT_TAG 7.0.10
GIT_TAG 7.0.12
)

include(AddJUCEModules)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ static void deferredCounterIncrementTest (bool fakeAudioThread = false)
chowdsp::DeferredAction action;
Counter counter;
std::atomic<int> refCounter { 0 };
std::atomic_bool isFinished { false };

juce::Thread::launch (
[&]
Expand All @@ -29,6 +30,7 @@ static void deferredCounterIncrementTest (bool fakeAudioThread = false)
refCounter.fetch_add (1);
juce::Thread::sleep (12);
}
isFinished.store (true);
});

for (int i = 0; i < 25; ++i)
Expand All @@ -39,16 +41,13 @@ static void deferredCounterIncrementTest (bool fakeAudioThread = false)
juce::MessageManager::getInstance()->runDispatchLoopUntil (15);
}

juce::MessageManager::getInstance()->runDispatchLoopUntil (500); // clear up any remaining async updates
while (! isFinished.load())
juce::MessageManager::getInstance()->runDispatchLoopUntil (500); // clear up any remaining async updates

REQUIRE_MESSAGE (counter.count == refCounter.load(), "Final count is incorrect!");
}

#if JUCE_WINDOWS
TEST_CASE ("Deferred Action Test", "[plugin][utilities][!mayfail]")
#else
TEST_CASE ("Deferred Action Test", "[plugin][utilities]")
#endif
{
SECTION ("Deferred Action Test")
{
Expand Down

0 comments on commit d2c5b42

Please sign in to comment.