Add estimate_dist() with primarycensored support #2247
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # Github Actions workflow to render EpiNow2 documents | |
| # yamllint disable rule:line-length | |
| name: Commands | |
| 'on': | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| document: | |
| if: contains(github.event.comment.body, '/document') | |
| name: document | |
| runs-on: macOS-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: r-lib/actions/pr-fetch@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: r-lib/actions/setup-r@v2 | |
| - name: Install dependencies | |
| run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)' | |
| - name: Document | |
| run: Rscript -e 'roxygen2::roxygenise()' | |
| - name: commit | |
| run: | | |
| git config --local user.email "actions@github.com" | |
| git config --local user.name "GitHub Actions" | |
| git add man/\* NAMESPACE | |
| git commit -m 'Document' | |
| - uses: r-lib/actions/pr-push@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| style: | |
| if: contains(github.event.comment.body, '/style') | |
| name: style | |
| runs-on: macOS-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: r-lib/actions/pr-fetch@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: r-lib/actions/setup-r@v2 | |
| - name: Install dependencies | |
| run: Rscript -e 'install.packages(c("styler", "roxygen2", "remotes"))' -e 'remotes::install_deps(dependencies = TRUE)' | |
| - name: Whitespace | |
| run: | | |
| find . -type f \( -name 'DESCRIPTION' -name "*.R" -o -name "*.stan" \) -exec sed -i '' -e 's/[ \t]*$//' {} \; | |
| - name: Style | |
| run: Rscript -e 'styler::style_pkg()' | |
| - name: Document | |
| run: Rscript -e 'roxygen2::roxygenise()' | |
| - name: commit | |
| run: | | |
| git config --local user.email "actions@github.com" | |
| git config --local user.name "GitHub Actions" | |
| git add \*.R | |
| git add \*.stan | |
| git add DESCRIPTION | |
| git add man/\* NAMESPACE | |
| git commit -m 'Style' | |
| - uses: r-lib/actions/pr-push@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| integration-tests: | |
| if: > | |
| github.event.issue.pull_request && | |
| contains(github.event.comment.body, '/integration-tests') | |
| name: integration-tests | |
| runs-on: macos-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| NOT_CRAN: true | |
| EPINOW2_SKIP_INTEGRATION: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: r-lib/actions/pr-fetch@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Post start comment | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '🧪 Starting integration tests... This may take ~1 hour.' | |
| }) | |
| - uses: r-lib/actions/setup-pandoc@v2 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: | | |
| stan-dev/cmdstanr | |
| - name: Install cmdstan | |
| uses: epinowcast/actions/install-cmdstan@v1 | |
| with: | |
| cmdstan-version: 'latest' | |
| num-cores: 2 | |
| - name: Run full test suite | |
| id: tests | |
| run: | | |
| testthat::test_local(reporter = testthat::ProgressReporter$new(max_failures = Inf)) | |
| shell: Rscript {0} | |
| - name: Post success comment | |
| if: success() | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '✅ Integration tests passed!' | |
| }) | |
| - name: Post failure comment | |
| if: failure() | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '❌ Integration tests failed. Check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.' | |
| }) |