Skip to content

Commit

Permalink
"Skip test when running on GitHub actions"
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Dec 14, 2023
1 parent c8454d1 commit f618087
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/Manipulations/BorderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
[[50, BorderType::Overlay, '333333']],
[[100, BorderType::Shrink, 'FAAAAA']],
[[100, BorderType::Expand, 'FAAAAA']],
]);
])->skipWhenRunningOnGitHub();
14 changes: 14 additions & 0 deletions tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,17 @@ function skipIfImagickDoesNotSupportFormat(string $format)
test()->markTestSkipped('Imagick does not support this format.');
}
}

function skipWhenRunningOnGitHub(): void
{
if (getenv('GITHUB_ACTIONS') !== false) {
test()->markTestSkipped('This test cannot run on GitHub actions');
}
}

function skipWhenRunningLocally(): void
{
if (getenv('GITHUB_ACTIONS') === false) {
test()->markTestSkipped('This test cannot run locally');
}
}

0 comments on commit f618087

Please sign in to comment.