Skip to content

Commit

Permalink
no need to build/test on any pure doc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gonuke committed Aug 16, 2023
1 parent ef287dd commit 25c9df6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- '.github/workflows/windows_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'
- 'doc/**'
push:
branches:
- develop
Expand All @@ -22,7 +22,7 @@ on:
- '.github/workflows/windows_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'
- 'doc/**'

jobs:
BuildTest:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mac_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- '.github/workflows/windows_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'
- 'doc/**'

push:
branches:
Expand All @@ -23,7 +23,7 @@ on:
- '.github/workflows/windows_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'
- 'doc/**'

release:
types: # This configuration does not affect the page_build event above
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- '.github/workflows/mac_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'
- 'doc/**'

push:
branches:
Expand All @@ -23,7 +23,7 @@ on:
- '.github/workflows/mac_build_test.yml'
- '.github/workflows/housekeeping.yml'
- 'CI/**'
- 'doc/CHANGELOG.rst'
- 'doc/**'

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
43 changes: 43 additions & 0 deletions tmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#ifndef _DAGMC_LOGGER
#define _DAGMC_LOGGER

#include <iostream>
#include <string>

class DagMC_Logger {
public:
DagMC_Logger(int _verbosity = 1) { set_verbosity(_verbosity); };

void set_verbosity(int val) {
int verbosity_min = 0;
int verbosity_max = 1;
if (val < verbosity_min || val > verbosity_max)
warning("Invalid verbosity value " + std::to_string(val) +
" will be set to nearest valid value.");
val = std::min(std::max(verbosity_min, val), verbosity_max);
verbosity = val;
}

int get_verbosity() const { return verbosity; };

void message(const std::string& msg, int lvl = 1, bool newline = true) const {
if (lvl > verbosity) return;
std::cout << msg;

if (newline) std::cout << "\n";
}

void warning(const std::string& msg, int lvl = 1, bool newline = true) const {
message("WARNING: " + msg, -1, newline);
}

void error(const std::string& msg, bool newline = true) const {
std::cerr << "ERROR: " << msg;
if (newline) std::cerr << "\n";
}

private:
int verbosity{1};
};

#endif

0 comments on commit 25c9df6

Please sign in to comment.