Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub Actions: Build Triggers, upload-artifact #720

Merged
merged 9 commits into from
Jan 13, 2025
46 changes: 0 additions & 46 deletions .github/workflows/build-deploy-doxygen.yml

This file was deleted.

36 changes: 28 additions & 8 deletions .github/workflows/build-doxygen.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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: '[email protected]' # your email
user_name: 'Christine Stawitz' # your login
commit_message: 'Docs: run Doxygen'
5 changes: 4 additions & 1 deletion .github/workflows/call-allcontributors.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/call-build-pkgdown.yml
Original file line number Diff line number Diff line change
@@ -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
35 changes: 22 additions & 13 deletions .github/workflows/call-calc-coverage.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/call-doc-and-style-r.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/call-r-cmd-check.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/call-spell-check.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions .github/workflows/call-update-pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 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]
branches: [main]
tags: ['*']

kellijohnson-NOAA marked this conversation as resolved.
Show resolved Hide resolved
jobs:
call-workflow:
uses: nmfs-fish-tools/ghactions4r/.github/workflows/update-pkgdown.yml@main
28 changes: 9 additions & 19 deletions .github/workflows/get-gtest-codecov.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -73,6 +66,3 @@ jobs:
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}



7 changes: 5 additions & 2 deletions .github/workflows/pr-checklist.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/run-clang-format.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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

Expand Down
Loading
Loading