Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ci_env.cpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
17#include "shamcmdopt/ci_env.hpp"
18#include "shamcmdopt/env.hpp"
19
20namespace {
21
22 using namespace shamcmdopt;
23
24 bool GITHUB_ACTIONS = bool(getenv_str("GITHUB_ACTIONS"));
25 bool TRAVIS = bool(getenv_str("TRAVIS"));
26 bool CIRCLECI = bool(getenv_str("CIRCLECI"));
27 bool GITLAB_CI = bool(getenv_str("GITLAB_CI"));
28
29} // namespace
30
31namespace shamcmdopt {
32
40 bool is_ci_github_actions() { return GITHUB_ACTIONS; }
41
49 bool is_ci_travis() { return TRAVIS; }
50
58 bool is_ci_circle_ci() { return CIRCLECI; }
59
67 bool is_ci_gitlab_ci() { return GITLAB_CI; }
68
69} // namespace shamcmdopt
namespace for cli utilities
Definition ci_env.hpp:19
bool is_ci_travis()
Check if the environment variable TRAVIS is set.
Definition ci_env.cpp:49
std::optional< std::string > getenv_str(const char *env_var)
Get the content of the environment variable if it exist.
Definition env.cpp:24
bool is_ci_github_actions()
Check if the environment variable GITHUB_ACTIONS is set.
Definition ci_env.cpp:40
bool is_ci_gitlab_ci()
Check if the environment variable GITLAB_CI is set.
Definition ci_env.cpp:67
bool is_ci_circle_ci()
Check if the environment variable CIRCLECI is set.
Definition ci_env.cpp:58