Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2f73c7d
adding version numbers for packages
micahwiesner67 Aug 20, 2025
269551a
adding exact versions
micahwiesner67 Aug 20, 2025
16ae3f9
adding R version
micahwiesner67 Aug 20, 2025
2c55ee4
specifying version of r to 4.4.1
micahwiesner67 Aug 20, 2025
bdadb49
testing update to R version as 3.5.0 min
micahwiesner67 Aug 20, 2025
8df25e4
updating pkgdown to be called after build
micahwiesner67 Aug 20, 2025
3a4b1b5
Merge branch 'main' into dev-specify-versions-description-mpw
micahwiesner67 Aug 20, 2025
7164170
testing where gh cli is installed
micahwiesner67 Aug 20, 2025
69da3a0
adding gh cli to pkgdown action
micahwiesner67 Aug 20, 2025
63e2c68
trying a different gh install action
micahwiesner67 Aug 20, 2025
e74fbe9
adding safe directory
micahwiesner67 Aug 20, 2025
a51e517
manually install gh cli
micahwiesner67 Aug 20, 2025
585a664
adding basic python install
micahwiesner67 Aug 20, 2025
1841492
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 20, 2025
fcf415e
testing
micahwiesner67 Aug 20, 2025
dfc5513
fixing merge conflict
micahwiesner67 Aug 20, 2025
a9e1721
fixing typo
micahwiesner67 Aug 20, 2025
3359355
Updating devcontainer
gvegayon Aug 27, 2025
de2dd89
Moving logic of dev to a bash script
gvegayon Aug 27, 2025
9c2c2b4
Using actions to install gh and python
gvegayon Aug 27, 2025
b93003a
Merge branch 'main' into dev-specify-versions-description-mpw-ggvy
gvegayon Aug 27, 2025
cfbdb65
Reverting container issues
gvegayon Aug 27, 2025
1e5c76c
Merge branch 'main' into dev-specify-versions-description-mpw-ggvy
gvegayon Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .devcontainer/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM docker.io/rocker/r-ver:4.4.1

# Will copy the package to the container preserving the directory structure
RUN mkdir -p pkg

COPY ./DESCRIPTION pkg/

# Installing missing dependencies (removing pandoc-citeproc install)
RUN apt-get update && apt-get install -y --no-install-recommends \
libcurl4-openssl-dev
RUN install2.r pak
# dependencies = TRUE means we install `suggests` too
RUN Rscript -e 'pak::local_install_deps("pkg", upgrade = FALSE, dependencies = TRUE)'
# The cmdstan version will need to be incrementally updated
# Must also manually bump cmdstan version `.github/workflows` when updating
RUN Rscript -e 'cmdstanr::install_cmdstan(version="2.36.0")'
# This requires access to the Azure Container Registry
# FROM ghcr.io/cdcgov/cfa-epinow2-pipeline:${TAG}

# Will copy the package to the container preserving the directory structure
COPY . pkg/

# Install the full package while leaving the tar.gz file in the
# container for later use.
RUN R CMD build --no-build-vignettes --no-manual pkg && \
R CMD INSTALL CFAEpiNow2Pipeline_*.tar.gz

# Ensure the package is working properly
ARG CHECK_PKG=true
RUN if [ "$CHECK_PKG" = "true" ]; then \
R CMD check --no-build-vignettes --no-manual CFAEpiNow2Pipeline_*.tar.gz; \
else \
echo "Skipping package check (CHECK_PKG=$CHECK_PKG)"; \
fi

ARG DEVELOPMENT=false
COPY ./extra.sh extra.sh
RUN chmod +x extra.sh && ./extra.sh && rm -rf extra.sh pkg/

CMD ["bash"]
40 changes: 40 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "epinow2-pipeline",
"build": {
"dockerfile": "../Dockerfile",
"args": {
"CHECK_PKG": "false",
"DEVELOPMENT": "true"
}
},
"customizations": {
"vscode": {
"extensions": [
"reditorsupport.r",
"rdebugger.r-debugger",
"quarto.quarto",
"tianyishi.rmarkdown"
]
}
},
"mounts": [
// Mount the .vscode configuration into the container
"source=${localWorkspaceFolder}/.devcontainer/.vscode,target=/workspaces/${localWorkspaceFolderBasename}/.vscode,type=bind,consistency=cached"
]
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "gcc -v",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
26 changes: 26 additions & 0 deletions .devcontainer/extra.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# If the development mode is true, then install the extra packages
if [ "$DEVELOPMENT" = "true" ]; then
echo "Development mode is enabled";

# Setting up dependencies
apt-get update && apt-get install \
libharfbuzz-dev libfribidi-dev libfontconfig1-dev \
libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev \
--no-install-recommends -y && \
install2.r --error devtools roxygen2 testthat languageserver && \

# Installing the httpgd package (requires libcairo)
apt-get install -y --no-install-recommends libcairo2-dev && \
installGithub.r nx10/httpgd;

# Installing pre-commit and uv
apt-get install pipx -y --no-install-recommends
echo 'PATH=/root/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
pipx install uv
pipx install pre-commit
pipx inject pre-commit pre-commit-uv
else
echo "Development mode is disabled";
fi
4 changes: 4 additions & 0 deletions .github/workflows/containers-and-az-pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ jobs:
needs: build-pipeline-image
uses: ./.github/workflows/test-documentation.yaml

pkgdown:
needs: build-pipeline-image
uses: ./.github/workflows/pkgdown.yaml

acr-import:
needs: build-pipeline-image
runs-on: ubuntu-latest
Expand Down
60 changes: 45 additions & 15 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:
workflow_call:

name: pkgdown website

jobs:
get-image-name:
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.image-name.outputs.image_name }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Extract branch name
id: branch-name
run: |
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT

- name: Figure out tag (either latest if it is main or the branch name)
id: image-tag
run: |
if [ "${{ steps.branch-name.outputs.branch }}" = "main" ]; then
echo "tag=latest" >> $GITHUB_OUTPUT
else
echo "tag=${{ steps.branch-name.outputs.branch }}" >> $GITHUB_OUTPUT
fi

- name: Build Docker Image String
id: image-name
run: echo "image_name=ghcr.io/cdcgov/cfa-epinow2-pipeline:${{ steps.image-tag.outputs.tag }}" >> $GITHUB_OUTPUT

pkgdown:
runs-on: ubuntu-latest
needs: get-image-name
container:
image: ${{ needs.get-image-name.outputs.IMAGE }}
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
Expand All @@ -22,24 +46,30 @@ jobs:
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v5

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
r-version: "4.4.3"
# Setting up gh CLI (cached)
- name: Setup GH CLI
uses: cli/gh-extension-precompile@v2

- uses: r-lib/actions/setup-r-dependencies@v2
# Installs python using a cached version
- uses: actions/setup-python@v5
with:
extra-packages: any::pkgdown, local::.
needs: website
python-version: '3.13'

# Installing pkgdown (won't be cached)
- name: Install pkgdown
run: |
install2.r pkgdown

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
run: |
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)

- name: Save artifact
if: ${{ github.event_name == 'pull_request' }}
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ Additional_repositories:
https://stan-dev.r-universe.dev
URL: https://cdcgov.github.io/cfa-epinow2-pipeline/
Depends:
R (>= 3.50)
R (>= 3.5.0)
LazyData: true
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ REGISTRY=cfaprdbatchcr.azurecr.io/
IMAGE_NAME=cfa-epinow2-pipeline
BRANCH=$(shell git branch --show-current)
CONFIG_CONTAINER=rt-epinow2-config

ifndef CNTR_MGR
CNTR_MGR=docker
endif

ifeq ($(BRANCH), main)
TAG=latest
else
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CFAEpiNow2Pipeline v0.2.0

## Features

* Adjust run trigger for time change
* Move first run earlier in the day
* Removing duplicative r-cmd-check.yaml file (already checking in Dockerfile)
Expand Down
Loading