From 2733fb264202b8212bc5620ef73053c58bb2083e Mon Sep 17 00:00:00 2001 From: LiNk-NY Date: Tue, 13 May 2025 11:11:09 -0400 Subject: [PATCH] add _pkgdown.yml and .github/workflows/pr_check.yml GHA --- .github/workflows/pr_check.yml | 91 ++++++++++++++++++++++++++++++++++ _pkgdown.yml | 26 ++++++++++ 2 files changed, 117 insertions(+) create mode 100644 .github/workflows/pr_check.yml create mode 100644 _pkgdown.yml diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml new file mode 100644 index 0000000..255e5dc --- /dev/null +++ b/.github/workflows/pr_check.yml @@ -0,0 +1,91 @@ +name: PR CMD check & build site + +on: + push: + paths: + - 'DESCRIPTION' + - '**.yml' + branches: + - RELEASE_3_21 + - pkgdown + +env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + CRAN: https://p3m.dev/cran/__linux__/noble/latest + BIOC_RELEASE: RELEASE_3_21 + +jobs: + check: + runs-on: ubuntu-latest + container: bioconductor/bioconductor_docker:RELEASE_3_21 + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + ref: ${{ env.BIOC_RELEASE }} + + - name: Copy .github and _pkgdown.yml + run: | + git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }} + git fetch origin pkgdown + git checkout origin/pkgdown -- .github + git checkout origin/pkgdown -- _pkgdown.yml + + - name: Query dependencies + run: | + BiocManager::install(c("covr", "BiocCheck")) + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + shell: Rscript {0} + + - name: Cache R packages + uses: actions/cache@v4 + with: + path: /usr/local/lib/R/site-library + key: ${{ runner.os }}-r-${{ env.BIOC_RELEASE }}-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-r-${{ env.BIOC_RELEASE }}- + + - name: Install Dependencies + run: | + remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories()) + BiocManager::install(c("rcmdcheck", "BiocCheck"), ask = FALSE, update = TRUE) + shell: Rscript {0} + + - name: Check Package + env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false + run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error", check_dir = "check") + shell: Rscript {0} + + - name: Run BiocCheck + id: bioccheck + run: | + BiocCheck::BiocCheck( + dir('check', 'tar.gz$', full.names = TRUE), + `quit-with-status` = TRUE, `no-check-bioc-help` = TRUE + ) + shell: Rscript {0} + + - name: Build pkgdown + run: | + PATH=$PATH:$HOME/bin/ Rscript -e 'pkgdown::build_site()' + + - name: Upload pkgdown artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs + + deploy: + needs: check + permissions: + contents: write + pages: write + id-token: write + runs-on: ubuntu-24.04 + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..b510c36 --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,26 @@ +url: https://bioconductor.github.io/BiocFileCache + +home: + strip_header: true + title: "BiocFileCache" + template: + bootstrap: 5 + params: + bootswatch: flatly + +navbar: + structure: + left: [intro, articles, reference, news] + right: [github] + components: + intro: ~ + articles: + text: "Articles" + href: articles/index.html + +vignettes: + - file: "BiocFileCache.Rmd" + home: TRUE + disable: TRUE + - file: "BiocFileCache_Troubleshooting.Rmd" + - file: "BiocFileCache_UseCases.Rmd"