diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 773dda6f2..3b13c9908 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -60,5 +60,10 @@ jobs: git config --global user.name 'Github Actions' git config --global user.email 'not@mail.com' git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} - git commit -am "$last_commit" - git diff --quiet @{u} HEAD || git push + # Only commit and push if there are changes + if ! git diff --cached --quiet; then + git commit -m "$last_commit" + git push + else + echo "Branch is up to date with origin/gh-pages, no need to update docs. Skipping." + fi diff --git a/tests/test_openml/test_config.py b/tests/test_openml/test_config.py index f9ab5eb9f..53d4abe77 100644 --- a/tests/test_openml/test_config.py +++ b/tests/test_openml/test_config.py @@ -54,7 +54,7 @@ def test_non_writable_home(self, log_handler_mock, warnings_mock): assert not log_handler_mock.call_args_list[0][1]["create_file_handler"] assert openml.config._root_cache_directory == Path(td) / "something-else" - @unittest.skipIf(platform.system() != "Linux","XDG only exists for Linux systems.") + @unittest.skipIf(platform.system() != "Linux", "XDG only exists for Linux systems.") def test_XDG_directories_do_not_exist(self): with tempfile.TemporaryDirectory(dir=self.workdir) as td: # Save previous state @@ -131,8 +131,11 @@ def test_switch_from_example_configuration(self): assert openml.config.server == self.production_server def test_example_configuration_stop_before_start(self): - """Verifies an error is raised is `stop_...` is called before `start_...`.""" + """Verifies an error is raised if `stop_...` is called before `start_...`.""" error_regex = ".*stop_use_example_configuration.*start_use_example_configuration.*first" + # Tests do not reset the state of this class. Thus, we ensure it is in + # the original state before the test. + openml.config.ConfigurationForExamples._start_last_called = False self.assertRaisesRegex( RuntimeError, error_regex,