From a390d85ae6f4357ee80bfdc9ea6d545a4a3978d8 Mon Sep 17 00:00:00 2001 From: LiNk-NY Date: Wed, 8 Jan 2025 20:16:56 -0500 Subject: [PATCH] add build_site.yml - remove old pkgdown.yaml --- .github/workflows/build_site.yml | 88 ++++++++++++++++++++++++++++++++ .github/workflows/pkgdown.yaml | 72 -------------------------- 2 files changed, 88 insertions(+), 72 deletions(-) create mode 100644 .github/workflows/build_site.yml delete mode 100644 .github/workflows/pkgdown.yaml diff --git a/.github/workflows/build_site.yml b/.github/workflows/build_site.yml new file mode 100644 index 0000000..b8057db --- /dev/null +++ b/.github/workflows/build_site.yml @@ -0,0 +1,88 @@ +name: Release R CMD check and build site + +on: + workflow_dispatch: + push: + branches: + - RELEASE_3_20 + paths: + - 'DESCRIPTION' + - '**.yml' + +env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + CRAN: https://packagemanager.posit.co/cran/__linux__/jammy/latest + BIOC_VERSION: RELEASE_3_20 + +jobs: + checkRelease: + runs-on: ubuntu-latest + strategy: + matrix: + bioc_version: [RELEASE_3_20] # Define versions as matrix variables + container: bioconductor/bioconductor_docker:${{ matrix.bioc_version }} + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + ref: ${{ env.BIOC_VERSION }} + + - name: Query dependencies + run: | + BiocManager::install("remotes") + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + shell: Rscript {0} + + - name: Cache R packages + if: runner.os != 'Windows' + uses: actions/cache@v4 + with: + path: /usr/local/lib/R/site-library + key: ${{ runner.os }}-r-${{ env.BIOC_VERSION }}-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-r-${{ env.BIOC_VERSION }}- + + - name: Install Dependencies + run: | + remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories()) + BiocManager::install(c("rcmdcheck", "pkgdown", "covr"), ask = FALSE, update = TRUE) + shell: Rscript {0} + + - name: Check Package + id: rcmdcheck + env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false + run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error", check_dir = "check") + shell: Rscript {0} + + - name: Test coverage + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + 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: checkRelease + permissions: + contents: write + pages: write + id-token: write + runs-on: ubuntu-latest + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml deleted file mode 100644 index d63cb58..0000000 --- a/.github/workflows/pkgdown.yaml +++ /dev/null @@ -1,72 +0,0 @@ -name: build -on: - push: - branches: - - RELEASE_3_18 - -env: - cache-version: v1 - -jobs: - build: - runs-on: ubuntu-22.04 - container: bioconductor/bioconductor_docker:RELEASE_3_18 - - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - R_REMOTES_STANDALONE: TRUE - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - CRAN: https://packagemanager.posit.co/cran/__linux__/jammy/latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - shell: Rscript {0} - - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v3 - with: - path: /usr/local/lib/R/site-library - key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r- - - - name: Install Package Dependencies - run: | - remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = TRUE, upgrade = TRUE) - BiocManager::install(c("rcmdcheck", "pkgdown"), 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 = "warning", check_dir = "check") - shell: Rscript {0} - - - name: generate codecov report - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: | - Rscript -e "suppressMessages(x <- covr::codecov())" - - - name: Build pkgdown - run: | - PATH=$PATH:$HOME/bin/ Rscript -e 'pkgdown::build_site(".")' - - # deploy needs rsync? Seems so. - - name: Install deploy dependencies - run: | - apt-get update - apt-get -y install rsync git - - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages # The branch the action should deploy to. - FOLDER: docs # The folder the action should deploy.