diff --git a/.github/workflows/build-deploy-doxygen.yml b/.github/workflows/build-deploy-doxygen.yml deleted file mode 100644 index 09c64016..00000000 --- a/.github/workflows/build-deploy-doxygen.yml +++ /dev/null @@ -1,46 +0,0 @@ -# Run doxygen to generate documentation from C++ code -name: build-deploy-doxygen -# The default build trigger is to run the action on every push for any branch -on: - workflow_dispatch: - push: - branches: - - main - # To run the default repository branch weekly on sunday, uncomment the following 2 lines - #schedule: - #- cron: '0 0 * * 0' - -jobs: - build-and-deploy-doxygen: - name: Build HTML documentation from C++ code - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - name: Get repository - uses: actions/checkout@v4 - - - name: Installing build dependencies - run: | - sudo apt update - sudo apt install cmake doxygen gcc git ninja-build - - - name: Building HTML documentation with Doxygen - run: | - cmake -S . -B build -G Ninja - cmake --build build --parallel 16 - mv build/html ./ - mv ./html ./docs - - - name: Push docs to FIMS-docs repo - uses: dmnemec/copy_file_to_another_repo_action@main - env: - API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} - with: - source_file: 'docs' - destination_repo: 'NOAA-FIMS/FIMS-docs' - destination_branch: 'main' - user_email: 'christine.stawitz@noaa.gov' # your email - user_name: 'Christine Stawitz' # your login - commit_message: 'Docs: run Doxygen' diff --git a/.github/workflows/build-doxygen.yml b/.github/workflows/build-doxygen.yml index ed091363..5780a584 100644 --- a/.github/workflows/build-doxygen.yml +++ b/.github/workflows/build-doxygen.yml @@ -1,16 +1,16 @@ -# Run doxygen to generate documentation from C++ code -# build doxygen, error on warnings. +# Run doxygen to generate documentation from C++ code, which is the equivalent +# of roxygen documentation in the R code. After building the html files, if the +# action is being ran on main, the files are moved to the appropriate location +# and pushed to NOAA-FIMS/FIMS-docs@main. name: run-doxygen -# The default build trigger is to run the action on every push for any branch + on: - workflow_dispatch: pull_request: push: branches: + - dev - main - # To run the default repository branch weekly on sunday, uncomment the following 2 lines - #schedule: - #- cron: '0 0 * * 0' + workflow_dispatch: jobs: build-doxygen: @@ -29,8 +29,28 @@ jobs: sudo apt install cmake doxygen gcc git ninja-build - name: Building HTML documentation with Doxygen - # Do not run mkdir docs and mv build/html docs locally # Do not run -DDOXYGEN_WARN_AS_ERROR=YES locally + # FIX? run cmake --build build --parallel 16 run: | cmake -S . -B build -G Ninja -DDOXYGEN_WARN_AS_ERROR=YES cmake --build build + + - name: Deploy html documentation with Doxygen + # Do not run mkdir docs and mv build/html docs locally + if: ${{ github.ref == 'refs/heads/main' }} + run: | + mv build/html ./ + mv ./html ./docs + + - name: Push docs to FIMS-docs repo + if: ${{ github.ref == 'refs/heads/main' }} + uses: dmnemec/copy_file_to_another_repo_action@main + env: + API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} + with: + source_file: 'docs' + destination_repo: 'NOAA-FIMS/FIMS-docs' + destination_branch: 'main' + user_email: 'christine.stawitz@noaa.gov' # your email + user_name: 'Christine Stawitz' # your login + commit_message: 'Docs: run Doxygen' diff --git a/.github/workflows/call-allcontributors.yml b/.github/workflows/call-allcontributors.yml index f4e367fc..07fc4eb0 100644 --- a/.github/workflows/call-allcontributors.yml +++ b/.github/workflows/call-allcontributors.yml @@ -1,9 +1,12 @@ +# Runs allcontributors::add_contributors() to add, or update, an alphabetized +# list of contributors to the README.md file and open a new PR with those +# changes. name: Collect contributors on: - workflow_dispatch: schedule: - cron: '0 8 * * 1' + workflow_dispatch: jobs: run-r-script: diff --git a/.github/workflows/call-build-pkgdown.yml b/.github/workflows/call-build-pkgdown.yml index 78da70b2..72085090 100644 --- a/.github/workflows/call-build-pkgdown.yml +++ b/.github/workflows/call-build-pkgdown.yml @@ -1,12 +1,15 @@ -# Checks that the pkgdown site builds for a repository. -# this assumes pkgdown is already set up. +# Checks that the pkgdown site builds for a repository, assuming that one +# already exists, but it does not actually deploy it. See +# call-update-pkgdown.yml for that. name: call-build-pkgdown -# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows + on: - workflow_dispatch: pull_request: branches: + - dev - main + workflow_dispatch: + jobs: call-workflow: uses: nmfs-fish-tools/ghactions4r/.github/workflows/build-pkgdown.yml@main diff --git a/.github/workflows/call-calc-coverage.yml b/.github/workflows/call-calc-coverage.yml index 0cf13ef6..97bb40e6 100644 --- a/.github/workflows/call-calc-coverage.yml +++ b/.github/workflows/call-calc-coverage.yml @@ -1,25 +1,34 @@ -# call a workflow that runs covr::codecov() to calculate code coverage +# Runs covr::codecov() to calculate code coverage. name: call-calc_coverage -# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows -# The default is to run the workflow on every push or pull request to every branch. + on: - workflow_dispatch: + pull_request: + branches: + - dev + - main paths-ignore: - .devcontainer - .github - - 'LICENSE' - - 'README.md' - - 'CONTRIBUTING.md' - - 'Rbuildignore' - '.gitignore' + - '.Rbuildignore' + - 'CONTRIBUTING.md' + - 'LICENSE' - 'man' + - 'README.md' push: branches: - - dev - pull_request: - branches: - - main - - dev + - dev + paths-ignore: + - .devcontainer + - .github + - '.gitignore' + - '.Rbuildignore' + - 'CONTRIBUTING.md' + - 'LICENSE' + - 'man' + - 'README.md' + workflow_dispatch: + jobs: call-workflow: uses: nmfs-fish-tools/ghactions4r/.github/workflows/calc-coverage.yml@main diff --git a/.github/workflows/call-doc-and-style-r.yml b/.github/workflows/call-doc-and-style-r.yml index 1aa97914..94977ad8 100644 --- a/.github/workflows/call-doc-and-style-r.yml +++ b/.github/workflows/call-doc-and-style-r.yml @@ -1,15 +1,15 @@ -# document and style using reusable workflow -# This workflow runs devtools::document and styler::style_active_package(), then opens a pull request to the branch -# That started the workflow with the changes +# Runs devtools::document() and styler::style_active_package(), then opens a +# pull request to the branch that had changes in the push that triggered the +# workflow. name: call-doc-and-style-r -# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows + on: -# workflow_dispatch requires pushing a button to run the workflow manually. uncomment the following line to add: - workflow_dispatch: - # Runs the workflow on each push to the main or master branch: push: - branches: + branches: + - dev - main + workflow_dispatch: + jobs: call-workflow: uses: nmfs-fish-tools/ghactions4r/.github/workflows/doc-and-style-r.yml@main diff --git a/.github/workflows/call-r-cmd-check.yml b/.github/workflows/call-r-cmd-check.yml index 8d61a669..f54fe003 100644 --- a/.github/workflows/call-r-cmd-check.yml +++ b/.github/workflows/call-r-cmd-check.yml @@ -1,13 +1,10 @@ -# Run r cmd check +# Runs R CMD CHECK on the package. name: call-r-cmd-check -# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows + on: - workflow_dispatch: -# The default build trigger is to run the action on every push and pull request, for any branch push: - # To run the default repository branch weekly on sunday, uncomment the following 2 lines - #schedule: - #- cron: '0 0 * * 0' + workflow_dispatch: + jobs: call-workflow: uses: nmfs-fish-tools/ghactions4r/.github/workflows/r-cmd-check.yml@main diff --git a/.github/workflows/call-spell-check.yml b/.github/workflows/call-spell-check.yml index 0e6d4d36..a776b7e0 100644 --- a/.github/workflows/call-spell-check.yml +++ b/.github/workflows/call-spell-check.yml @@ -1,17 +1,17 @@ -# run devtools::spell_check() +# Runs devtools::spell_check(). name: call-spell-check -# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows + on: -# this workflow runs on pushing to main, pull requests to main, and manually. - push: - branches: - - main - - dev pull_request: branches: + - dev - main + push: + branches: - dev + - main workflow_dispatch: + jobs: call-workflow: uses: nmfs-fish-tools/ghactions4r/.github/workflows/spell-check.yml@main diff --git a/.github/workflows/call-update-pkgdown.yml b/.github/workflows/call-update-pkgdown.yml index 58c9c154..72fef42e 100644 --- a/.github/workflows/call-update-pkgdown.yml +++ b/.github/workflows/call-update-pkgdown.yml @@ -1,12 +1,11 @@ -# updates exiting pkgdown site for a repository -# deploys to a branch gh-pages +# Updates the exiting pkgdown site for a repository by deploying the changes +# made to the pkgdown site to a branch called gh-pages. name: call-update-pkgdown -# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows + on: -# this workflow runs on pushes to main or master or any time a new tag is pushed push: - branches: [main, master] - tags: ['*'] + branches: [main] + jobs: call-workflow: uses: nmfs-fish-tools/ghactions4r/.github/workflows/update-pkgdown.yml@main diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 00000000..bdb89412 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,9 @@ +# Uses dependabot to check things +version: 2 +updates: + # Enable version updates for GitHub Actions + - package-ecosystem: "github-actions" + # The default location of the bot is `.github/workflows` + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/get-gtest-codecov.yml b/.github/workflows/get-gtest-codecov.yml index 473e08a8..05f6d4ab 100644 --- a/.github/workflows/get-gtest-codecov.yml +++ b/.github/workflows/get-gtest-codecov.yml @@ -1,23 +1,16 @@ -# Get GoogleTest code coverage +# Gets the GoogleTest code coverage metrics. name: get-gtest-codecov -# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows + on: - workflow_dispatch: - push: - branches: - - main - paths-ignore: - - .devcontainer - - .github - - 'LICENSE' - - 'README.md' - - 'CONTRIBUTING.md' - - 'Rbuildignore' - - '.gitignore' - - 'man' pull_request: branches: + - dev - main + push: + branches: + - dev + - main + workflow_dispatch: jobs: build: @@ -63,7 +56,7 @@ jobs: gcovr --exclude tests/ --cobertura coverage.xml - name: save coverage report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage.xml path: coverage.xml @@ -73,6 +66,3 @@ jobs: with: files: coverage.xml token: ${{ secrets.CODECOV_TOKEN }} - - - diff --git a/.github/workflows/pr-checklist.yml b/.github/workflows/pr-checklist.yml index d37dd731..bc2c6c5e 100644 --- a/.github/workflows/pr-checklist.yml +++ b/.github/workflows/pr-checklist.yml @@ -1,9 +1,12 @@ -# This workflow automatically adds a comment containing a reviewer checklist -# when a new pull request is opened. +# Adds a comment to a newly opened PR letting reviewers know what should be +# included in their review. +# TODO: change this to email the assigned reviewer name: Add a comment with reviewer checklist when PR opened + on: pull_request: types: [opened] + jobs: pr-checklist: runs-on: ubuntu-latest diff --git a/.github/workflows/run-clang-format.yml b/.github/workflows/run-clang-format.yml index 966e5d57..3cfff215 100644 --- a/.github/workflows/run-clang-format.yml +++ b/.github/workflows/run-clang-format.yml @@ -1,20 +1,17 @@ -# Run clang-format -# This workflow runs clang-format to format C++ code and then creates -# a pull request to commit the changed files to the main branch. -# More details about clang-format can be found here: -# https://clang.llvm.org/docs/ClangFormat.html. To style -# C++ code in VS Code locally, you could follow the instructions on this -# website https://code.visualstudio.com/docs/editor/codebasics#_formatting -# to format the entire file or selected text. - +# Runs clang-format to format C++ code and then creates a PR to the branch +# which had changes and triggered this action. More details about clang-format +# can be found here: https://clang.llvm.org/docs/ClangFormat.html. To style C++ +# code in VS Code locally, you could follow the instructions on this website +# https://code.visualstudio.com/docs/editor/codebasics#_formatting to format +# the entire file or selected text. name: run-clang-format on: - workflow_dispatch: -# Runs the workflow on each push to the main or master branch: push: branches: + - dev - main + workflow_dispatch: jobs: job: @@ -24,11 +21,10 @@ jobs: # We use Google style to format code. steps: - uses: actions/checkout@v4 - - uses: DoozyX/clang-format-lint-action@v0.14 + - uses: DoozyX/clang-format-lint-action@v0.18.1 with: source: './inst/include ./src ./tests/gtest' extensions: 'hpp, cpp' - clangFormatVersion: 13.0.0 style: Google inplace: True diff --git a/.github/workflows/run-clang-tidy.yml b/.github/workflows/run-clang-tidy.yml index 08351218..52fb09ee 100644 --- a/.github/workflows/run-clang-tidy.yml +++ b/.github/workflows/run-clang-tidy.yml @@ -1,16 +1,24 @@ -# Run clang-tidy -# This workflow runs Clang-tidy checks (https://clang.llvm.org/extra/clang-tidy/index.html) on C++ code. It is for diagnosing typical programming errors (e.g., interface misuse or bugs that can be detected via static analysis). -# Please see details of each Clang-tidy Check from this website: https://clang.llvm.org/extra/clang-tidy/checks/list.html -# This workflow checks code through valid CMakeLists.txt files. It only checks .cpp files and their associated .hpp files that are used for compilation. If the workflow fails after pushing commits to the repo, please check the GitHub Actions log and fix programming errors. +# Runs clang-tidy checks (https://clang.llvm.org/extra/clang-tidy/index.html) +# on C++ code. It is for diagnosing typical programming errors (e.g., interface +# misuse or bugs that can be detected via static analysis). +# Please see details of each Clang-tidy Check from this website: +# https://clang.llvm.org/extra/clang-tidy/checks/list.html This workflow checks +# code through valid CMakeLists.txt files. It only checks .cpp files and their +# associated .hpp files that are used for compilation. If the workflow fails +# after pushing commits to the repo, please check the GitHub Actions log and +# fix programming errors. name: run-clang-tidy on: - workflow_dispatch: - # The default build trigger is to run the action on every push and pull request, for any branch + pull_request: + branches: + - dev + - main push: - # To run the default repository branch weekly on sunday, uncomment the following 2 lines - #schedule: - #- cron: '0 0 * * 0' + branches: + - dev + - main + workflow_dispatch: jobs: job: diff --git a/.github/workflows/run-googletest.yml b/.github/workflows/run-googletest.yml index 67da5a4f..db967153 100644 --- a/.github/workflows/run-googletest.yml +++ b/.github/workflows/run-googletest.yml @@ -1,13 +1,10 @@ -# Run C++ tests using GoogleTest +# Runs C++ tests using GoogleTest. name: run-googletest -# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows + on: - workflow_dispatch: -# The default build trigger is to run the action on every push and pull request, for any branch push: - # To run the default repository branch weekly on sunday, uncomment the following 2 lines - #schedule: - #- cron: '0 0 * * 0' + workflow_dispatch: + jobs: build: runs-on: ${{ matrix.os }} @@ -49,7 +46,7 @@ jobs: ctest --test-dir build --parallel 16 - name: Upload log when tests failed - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: googletest-log-${{ matrix.os }}