diff --git a/.github/workflows/R-CMD-check-dev.yaml b/.github/workflows/R-CMD-check-dev.yaml index 185f378..23c4a6b 100644 --- a/.github/workflows/R-CMD-check-dev.yaml +++ b/.github/workflows/R-CMD-check-dev.yaml @@ -13,14 +13,14 @@ name: rcc dev jobs: matrix: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} name: Collect deps steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/workflows/rate-limit with: @@ -34,7 +34,7 @@ jobs: uses: ./.github/workflows/dep-matrix check-matrix: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 needs: matrix name: Check deps @@ -52,7 +52,7 @@ jobs: echo $matrix | json2yaml R-CMD-check-base: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 name: base @@ -61,10 +61,9 @@ jobs: strategy: fail-fast: false - matrix: ${{fromJson(needs.matrix.outputs.matrix)}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/workflows/custom/before-install if: hashFiles('.github/workflows/custom/before-install/action.yml') != '' @@ -100,7 +99,7 @@ jobs: - matrix - R-CMD-check-base - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 name: ${{ matrix.package }} @@ -112,7 +111,7 @@ jobs: matrix: ${{fromJson(needs.matrix.outputs.matrix)}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/workflows/custom/before-install if: hashFiles('.github/workflows/custom/before-install/action.yml') != '' diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 8b477ab..921c120 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -17,7 +17,7 @@ on: - cron: "10 0 * * *" concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.sha }}-${{ github.base_ref || '' }} cancel-in-progress: true name: rcc @@ -34,7 +34,7 @@ jobs: # End custom: services steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/workflows/rate-limit with: @@ -49,7 +49,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} install-r: false - cache-version: rcc-smoke-1 + cache-version: rcc-smoke-2 needs: check extra-packages: any::rcmdcheck any::roxygen2 r-lib/styler @@ -86,7 +86,7 @@ jobs: # End custom: services steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ needs.rcc-smoke.outputs.sha }} @@ -137,10 +137,11 @@ jobs: matrix: config: - {os: windows-latest, r: 'release'} - # Broken checks on R 3.6 + # Use 3.6 to trigger usage of RTools35 + - {os: windows-latest, r: '3.6'} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ needs.rcc-smoke.outputs.sha }} @@ -178,31 +179,32 @@ jobs: fail-fast: false matrix: config: - - {os: macOS-latest, r: 'release'} + - {os: macos-latest, r: 'release'} - {os: ubuntu-20.04, r: 'release'} # Use older ubuntu to maximise backward compatibility - - {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-18.04, r: 'release', covr: true, desc: 'with covr'} - - {os: ubuntu-18.04, r: 'oldrel-1'} + - {os: ubuntu-22.04, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-22.04, r: 'release', covr: true, desc: 'with covr'} + - {os: ubuntu-22.04, r: 'oldrel-1'} # Begin custom: R 3.6 - - {os: ubuntu-18.04, r: 'oldrel-2'} + - {os: ubuntu-22.04, r: 'oldrel-2'} # End custom: R 3.6 # Begin custom: R 3.5 - - {os: ubuntu-18.04, r: 'oldrel-3'} + - {os: ubuntu-22.04, r: 'oldrel-3'} # End custom: R 3.5 # Begin custom: R 3.4 + - {os: ubuntu-22.04, r: 'oldrel-4'} # End custom: R 3.4 # Begin custom: matrix elements # End custom: matrix elements steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ needs.rcc-smoke.outputs.sha }} @@ -225,3 +227,122 @@ jobs: - uses: ./.github/workflows/check with: results: ${{ runner.os }}-r${{ matrix.config.r }} + + suggests-matrix: + runs-on: ubuntu-22.04 + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + + name: Collect suggests deps + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: ./.github/workflows/rate-limit + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - uses: r-lib/actions/setup-r@v2 + with: + install-r: false + use-public-rspm: true + + - id: set-matrix + uses: ./.github/workflows/dep-matrix-suggests + + check-matrix: + runs-on: ubuntu-22.04 + needs: suggests-matrix + + name: Check deps + + if: ${{ needs.matrix.outputs.matrix != '' }} + + steps: + - name: Install json2yaml + run: | + sudo npm install -g json2yaml + + - name: Check matrix definition + run: | + matrix='${{ needs.matrix.outputs.matrix }}' + echo $matrix + echo $matrix | jq . + echo $matrix | json2yaml + + rcc-suggests: + needs: + - suggests-matrix + - rcc-smoke + + runs-on: ubuntu-22.04 + + name: Without ${{ matrix.package }} + + if: ${{ needs.suggests-matrix.outputs.matrix != '' }} + + # Begin custom: services + # End custom: services + + strategy: + fail-fast: false + matrix: ${{fromJson(needs.suggests-matrix.outputs.matrix)}} + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/workflows/custom/before-install + if: hashFiles('.github/workflows/custom/before-install/action.yml') != '' + + - uses: ./.github/workflows/install + with: + install-r: false + cache-version: rcc-dev-${{ matrix.package }}-1 + needs: check + extra-packages: "any::rcmdcheck any::remotes ." + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Remove ${{ matrix.package }} and all strong dependencies + run: | + pkg <- "${{ matrix.package }}" + pkgs <- tools::package_dependencies(pkg, reverse = TRUE)[[1]] + installed <- rownames(utils::installed.packages()) + to_remove <- c(pkg, intersect(pkgs, installed)) + print(to_remove) + remove.packages(to_remove) + shell: Rscript {0} + + - name: Session info + run: | + options(width = 100) + if (!requireNamespace("sessioninfo", quietly = TRUE)) install.packages("sessioninfo") + pkgs <- installed.packages()[, "Package"] + sessioninfo::session_info(pkgs, include_base = TRUE) + shell: Rscript {0} + + - uses: ./.github/workflows/custom/after-install + if: hashFiles('.github/workflows/custom/after-install/action.yml') != '' + + - name: Define _R_CHECK_FORCE_SUGGESTS_ + run: | + cat('_R_CHECK_FORCE_SUGGESTS_=false\n', file = Sys.getenv("GITHUB_ENV"), append = TRUE) + shell: Rscript {0} + + - name: Must allow NOTEs, even with _R_CHECK_FORCE_SUGGESTS_ + run: | + if (Sys.getenv("RCMDCHECK_ERROR_ON") %in% c("", "note")) { + cat('RCMDCHECK_ERROR_ON="warning"\n', file = Sys.getenv("GITHUB_ENV"), append = TRUE) + } + shell: Rscript {0} + + - name: Check env vars + run: | + print(Sys.getenv('_R_CHECK_FORCE_SUGGESTS_')) + print(Sys.getenv('RCMDCHECK_ERROR_ON')) + shell: Rscript {0} + + - uses: ./.github/workflows/check + with: + results: ${{ matrix.package }} diff --git a/.github/workflows/check/action.yml b/.github/workflows/check/action.yml index 4601d3f..afb3819 100644 --- a/.github/workflows/check/action.yml +++ b/.github/workflows/check/action.yml @@ -9,6 +9,8 @@ runs: steps: - uses: r-lib/actions/check-r-package@v2 with: + # Fails on R 3.6 on Windows, remove when this job is removed? + args: 'c("--no-manual", "--as-cran", "--no-multiarch")' error-on: ${{ env.RCMDCHECK_ERROR_ON || '"note"' }} - name: Run coverage check diff --git a/.github/workflows/commit/action.yml b/.github/workflows/commit/action.yml index b6f2111..89be422 100644 --- a/.github/workflows/commit/action.yml +++ b/.github/workflows/commit/action.yml @@ -24,6 +24,6 @@ runs: git add . git commit -m "Auto-update from GitHub Actions"$'\n'$'\n'"Run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" git push -u origin HEAD - echo ::set-output name=sha::$(git rev-parse HEAD) + echo sha=$(git rev-parse HEAD) >> $GITHUB_OUTPUT fi shell: bash diff --git a/.github/workflows/dep-matrix-suggests/action.yml b/.github/workflows/dep-matrix-suggests/action.yml new file mode 100644 index 0000000..deafab9 --- /dev/null +++ b/.github/workflows/dep-matrix-suggests/action.yml @@ -0,0 +1,56 @@ +name: "Actions to compute a matrix with all suggested packages" +outputs: + matrix: + description: "Generated matrix" + value: ${{ steps.set-matrix.outputs.matrix }} + +runs: + using: "composite" + steps: + - id: set-matrix + run: | + get_deps <- function() { + # Determine package dependencies + if (!requireNamespace("desc", quietly = TRUE)) { + install.packages("desc") + } + + deps_df <- desc::desc_get_deps() + deps_df_optional <- deps_df$package[deps_df$type %in% c("Suggests", "Enhances")] + deps_df_hard <- deps_df$package[deps_df$type %in% c("Depends", "Imports", "LinkingTo")] + + packages <- sort(deps_df_optional) + packages <- intersect(packages, rownames(available.packages())) + + # Too big to fail, or can't be avoided: + off_limits <- c("testthat", "rmarkdown", "rcmdcheck", deps_df_hard) + off_limits_dep <- unlist(tools::package_dependencies(off_limits, recursive = TRUE, which = "strong")) + setdiff(packages, c(off_limits, off_limits_dep)) + } + + if (Sys.getenv("GITHUB_BASE_REF") != "") { + print(Sys.getenv("GITHUB_BASE_REF")) + has_diff <- (system("git diff ${{ github.event.pull_request.base.sha }}... | egrep '^[+][^+]' | grep -q ::") == 0) + if (has_diff) { + system("git diff ${{ github.event.pull_request.base.sha }}... | egrep '^[+][^+]' | grep -q ::") + packages <- get_deps() + } else { + writeLines("No changes using :: found, not checking without suggested packages") + packages <- character() + } + } else { + packages <- get_deps() + } + + if (length(packages) > 0) { + json <- paste0( + '{"package":[', + paste0('"', packages, '"', collapse = ","), + ']}' + ) + writeLines(json) + writeLines(paste0("matrix=", json), Sys.getenv("GITHUB_OUTPUT")) + } else { + writeLines("Package list empty!") + } + shell: Rscript {0} diff --git a/.github/workflows/dep-matrix/action.yml b/.github/workflows/dep-matrix/action.yml index 601ce8d..35dcb3c 100644 --- a/.github/workflows/dep-matrix/action.yml +++ b/.github/workflows/dep-matrix/action.yml @@ -130,5 +130,5 @@ runs: ']}' ) writeLines(json) - writeLines(paste0("::set-output name=matrix::", json)) + writeLines(paste0("matrix=", json), Sys.getenv("GITHUB_OUTPUT")) shell: Rscript {0} diff --git a/.github/workflows/fledge.yaml b/.github/workflows/fledge.yaml new file mode 100644 index 0000000..81c2d0c --- /dev/null +++ b/.github/workflows/fledge.yaml @@ -0,0 +1,58 @@ +name: fledge + +on: + # for manual triggers + workflow_dispatch: + # daily run + schedule: + - cron: "30 0 * * *" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.sha }}-${{ github.base_ref || '' }} + cancel-in-progress: true + +jobs: + check_fork: + runs-on: ubuntu-latest + outputs: + is_forked: ${{ steps.check.outputs.is_forked }} + steps: + - name: Check if the repo is forked + id: check + run: | + echo "is_forked=$(curl -s -H "Accept: application/vnd.github+json" -H 'Authorization: Bearer ${{ github.token }}' -H "X-GitHub-Api-Version: 2022-11-28" ${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY} | jq .fork)" >> $GITHUB_OUTPUT + + fledge: + runs-on: ubuntu-latest + needs: check_fork + if: needs.check_fork.outputs.is_forked == 'false' + permissions: + contents: write + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + FLEDGE_GHA_CI: true + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: ./.github/workflows/git-identity + + - uses: ./.github/workflows/install + with: + token: ${{ secrets.GITHUB_TOKEN }} + install-r: false + cache-version: fledge-1 + packages: cynkra/fledge + + - name: Bump version + run: | + if (fledge::bump_version(which = "dev", no_change_behavior = "noop")) { + fledge::finalize_version(push = TRUE) + } + shell: Rscript {0} + + - name: Check release + run: | + fledge:::release_after_cran_built_binaries() + shell: Rscript {0} diff --git a/.github/workflows/get-extra/action.yml b/.github/workflows/get-extra/action.yml index a5614b5..84c56d9 100644 --- a/.github/workflows/get-extra/action.yml +++ b/.github/workflows/get-extra/action.yml @@ -12,5 +12,5 @@ runs: run: | set -x packages=$( ( grep Config/gha/extra-packages DESCRIPTION || true ) | cut -d " " -f 2) - echo ::set-output name=packages::$packages + echo packages=$packages >> $GITHUB_OUTPUT shell: bash diff --git a/.github/workflows/install/action.yml b/.github/workflows/install/action.yml index 1779371..cf83bdb 100644 --- a/.github/workflows/install/action.yml +++ b/.github/workflows/install/action.yml @@ -15,6 +15,10 @@ inputs: description: Passed on to r-lib/actions/setup-r-dependencies@v2 required: false default: "" + packages: + description: Passed on to r-lib/actions/setup-r-dependencies@v2 + required: false + default: deps::., any::sessioninfo extra-packages: description: Passed on to r-lib/actions/setup-r-dependencies@v2 required: false @@ -61,7 +65,8 @@ runs: with: pak-version: devel needs: ${{ inputs.needs }} - extra-packages: ${{ inputs.extra-packages }} ${{ matrix.config.covr && 'any::covr' }} ${{ steps.get-extra.outputs.packages }} + packages: ${{ inputs.packages }} + extra-packages: ${{ inputs.extra-packages }} ${{ ( matrix.config.covr && 'any::covr' ) || '' }} ${{ steps.get-extra.outputs.packages }} cache-version: ${{ inputs.cache-version }} - name: Add pkg.lock to .gitignore @@ -78,3 +83,35 @@ runs: sudo ln -s $(which true) /usr/local/bin/qpdf sudo ln -s $(which true) /usr/local/bin/checkbashisms shell: bash + + - name: Install ccache + uses: krlmlr/ccache-action@parallel-dir + with: + max-size: 10G + verbose: 1 + save: false + restore: false + + - name: Use ccache for compiling R code, and parallelize + run: | + mkdir -p ~/.R + echo 'CC := ccache $(CC)' >> ~/.R/Makevars + echo 'CXX := ccache $(CXX)' >> ~/.R/Makevars + echo 'CXX11 := ccache $(CXX11)' >> ~/.R/Makevars + echo 'CXX14 := ccache $(CXX14)' >> ~/.R/Makevars + echo 'CXX17 := ccache $(CXX17)' >> ~/.R/Makevars + echo 'MAKEFLAGS = -j2' >> ~/.R/Makevars + cat ~/.R/Makevars + + echo 'CCACHE_SLOPPINESS=locale,time_macros' | tee -a $GITHUB_ENV + + # echo 'CCACHE_DEBUG=true' | tee -a $GITHUB_ENV + # echo "CCACHE_DEBUGDIR=$(dirname $(pwd))/ccache-debug" | tee -a $GITHUB_ENV + # mkdir -p $(dirname $(pwd))/.ccache-debug + + echo 'PKG_BUILD_EXTRA_FLAGS=false' | tee -a $GITHUB_ENV + + # Repair + git rm -rf .ccache || true + rm -rf .ccache + shell: bash diff --git a/.github/workflows/lock.yaml b/.github/workflows/lock.yaml index 9e33a1f..5b19556 100644 --- a/.github/workflows/lock.yaml +++ b/.github/workflows/lock.yaml @@ -8,7 +8,7 @@ jobs: lock: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v2 + - uses: dessant/lock-threads@v4 with: github-token: ${{ github.token }} issue-lock-inactive-days: "365" diff --git a/.github/workflows/pkgdown-deploy/action.yml b/.github/workflows/pkgdown-deploy/action.yml index 69a2b31..18d0206 100644 --- a/.github/workflows/pkgdown-deploy/action.yml +++ b/.github/workflows/pkgdown-deploy/action.yml @@ -4,6 +4,9 @@ runs: using: "composite" steps: - name: Deploy site - run: | - pkgdown::deploy_to_branch(new_process = FALSE) - shell: Rscript {0} + uses: nick-fields/retry@v2 + with: + timeout_minutes: 15 + max_attempts: 10 + command: | + R -q -e 'pkgdown::deploy_to_branch(new_process = FALSE)' diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index dda4431..7400040 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -6,9 +6,14 @@ on: branches: - "docs*" - "cran-*" + workflow_dispatch: name: pkgdown +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.sha }}-${{ github.base_ref || '' }} + cancel-in-progress: true + jobs: pkgdown: runs-on: ubuntu-latest @@ -19,7 +24,7 @@ jobs: # End custom: services steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ./.github/workflows/rate-limit with: @@ -35,7 +40,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} install-r: false - cache-version: pkgdown-1 + cache-version: pkgdown-2 needs: website extra-packages: r-lib/pkgdown local::. diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml index 9047d4e..3ce95aa 100644 --- a/.github/workflows/pr-commands.yaml +++ b/.github/workflows/pr-commands.yaml @@ -11,7 +11,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/pr-fetch@master with: repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -50,7 +50,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/pr-fetch@master with: repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -83,7 +83,7 @@ jobs: merge: if: startsWith(github.event.comment.body, '/merge') name: merge - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Create and merge pull request run: | @@ -98,6 +98,6 @@ jobs: # curl -s -X PUT --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $PR_URL/merge # A mock job just to ensure we have a successful build status finish: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - run: true diff --git a/.github/workflows/revdep.yaml b/.github/workflows/revdep.yaml index dc8e608..4a0d511 100644 --- a/.github/workflows/revdep.yaml +++ b/.github/workflows/revdep.yaml @@ -8,7 +8,7 @@ name: revdep jobs: matrix: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} @@ -29,7 +29,7 @@ jobs: curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit shell: bash - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # FIXME: Avoid reissuing succesful jobs # https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-jobs-for-a-workflow-run @@ -44,11 +44,11 @@ jobs: ']}' ) writeLines(json) - writeLines(paste0("::set-output name=matrix::", json)) + writeLines(paste0("matrix=", json), Sys.getenv("GITHUB_OUTPUT")) shell: Rscript {0} check-matrix: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 needs: matrix steps: - name: Install json2yaml @@ -65,7 +65,7 @@ jobs: R-CMD-check: needs: matrix - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 name: ${{ matrix.package }} @@ -91,7 +91,7 @@ jobs: curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit shell: bash - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # Begin custom: before install # End custom: before install @@ -113,7 +113,7 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update -y - Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "18.04")); package <- "${{ matrix.package }}"; deps <- tools::package_dependencies(package, which = "Suggests")[[1]]; lapply(c(package, deps), function(x) { writeLines(remotes::system_requirements("ubuntu", "18.04", package = x)) })' | sort | uniq > .github/deps.sh + Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "22.04")); package <- "${{ matrix.package }}"; deps <- tools::package_dependencies(package, which = "Suggests")[[1]]; lapply(c(package, deps), function(x) { writeLines(remotes::system_requirements("ubuntu", "22.04", package = x)) })' | sort | uniq > .github/deps.sh cat .github/deps.sh sudo sh < .github/deps.sh diff --git a/.github/workflows/style/action.yml b/.github/workflows/style/action.yml index a733a2e..b209d9e 100644 --- a/.github/workflows/style/action.yml +++ b/.github/workflows/style/action.yml @@ -10,12 +10,12 @@ runs: scope=$( ( grep Config/autostyle/scope DESCRIPTION || true ) | cut -d " " -f 2) strict=$( ( grep Config/autostyle/strict DESCRIPTION || true ) | cut -d " " -f 2) rmd=$( ( grep Config/autostyle/rmd DESCRIPTION || true ) | cut -d " " -f 2) - echo ::set-output name=scope::$scope - echo ::set-output name=strict::$strict - echo ::set-output name=rmd::$rmd + echo scope=$scope >> $GITHUB_OUTPUT + echo strict=$strict >> $GITHUB_OUTPUT + echo rmd=$rmd >> $GITHUB_OUTPUT shell: bash - - uses: actions/cache@v2 + - uses: actions/cache@v3 if: ${{ steps.check.outputs.scope }} with: path: | @@ -24,18 +24,18 @@ runs: restore-keys: | ${{ runner.os }}-2- - - name: Show cache + - name: Imprint run ID if: ${{ steps.check.outputs.scope }} run: | - ls -l ~/.cache/R/R.cache - ls -l ~/.cache/R/R.cache/styler - gdu -s --inodes ~/.cache/R/R.cache/styler/* || du -s --inodes ~/.cache/R/R.cache/styler/* + mkdir -p ~/.cache/R/R.cache/styler + touch ~/.cache/R/R.cache/${{ github.run_id }} shell: bash - - name: Imprint run ID + - name: Show cache if: ${{ steps.check.outputs.scope }} run: | - touch ~/.cache/R/R.cache/${{ github.run_id }} + ls -l ~/.cache/R/R.cache + ls -l ~/.cache/R/R.cache/styler shell: bash - name: Enable styler cache diff --git a/.github/workflows/update-snapshots/action.yml b/.github/workflows/update-snapshots/action.yml index cd58bf7..2e1db0e 100644 --- a/.github/workflows/update-snapshots/action.yml +++ b/.github/workflows/update-snapshots/action.yml @@ -26,7 +26,7 @@ runs: print(failures[names(failures) != "result"]) print(failures$result) testthat::snapshot_accept() - writeLines("::set-output name=changed::true") + writeLines("changed=true", Sys.getenv("GITHUB_OUTPUT")) } else { writeLines("Snapshot tests ran successfully.") } @@ -50,7 +50,7 @@ runs: if: ${{ steps.run-tests.outputs.changed }} id: check-changed run: | - echo "::set-output name=changed::$(git status --porcelain -- tests/testthat/_snaps)" + echo "changed=$(git status --porcelain -- tests/testthat/_snaps | head -n 1)" >> $GITHUB_OUTPUT shell: bash - name: Derive branch name @@ -58,19 +58,20 @@ runs: id: matrix-desc run: | config=$(echo '${{ toJSON(matrix) }}' | jq -c .) - echo "::set-output name=text::$(echo ${config})" - echo "::set-output name=branch::$(echo ${config} | sed -r 's/[^0-9a-zA-Z]+/-/g;s/^-//;s/-$//')" + echo "text=$(echo ${config})" >> $GITHUB_OUTPUT + echo "branch=$(echo ${config} | sed -r 's/[^0-9a-zA-Z]+/-/g;s/^-//;s/-$//')" >> $GITHUB_OUTPUT shell: bash - name: Create pull request if: ${{ steps.check-changed.outputs.changed }} id: cpr - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v5 with: base: ${{ github.head_ref }} branch: snapshot-${{ github.ref_name }}-${{ github.job }}-${{ steps.matrix-desc.outputs.branch }} delete-branch: true title: Snapshot updates for ${{ github.job }} (${{ steps.matrix-desc.outputs.text }}) + body: "Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action${{ github.event.number && format(' for #{0}', github.event.number) || '' }}." add-paths: | tests/testthat/_snaps diff --git a/DESCRIPTION b/DESCRIPTION index 58c2375..06a284d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: wrswoR Title: Weighted Random Sampling without Replacement -Version: 1.1.1.9000 -Date: 2020-07-26 +Version: 1.1.1.9005 +Date: 2023-10-09 Authors@R: person(given = "Kirill", family = "M\u00fcller", diff --git a/NEWS.md b/NEWS.md index 97319a9..e38746c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,50 @@ + + +# wrswoR 1.1.1.9005 (2023-10-09) + +- Internal changes only. + + +# wrswoR 1.1.1.9004 (2023-03-24) + +- Internal changes only. + + +# wrswoR 1.1.1.9003 (2023-02-17) + +- Internal changes only. + + +# wrswoR 1.1.1.9002 (2022-12-30) + +- Internal changes only. + + +# wrswoR 1.1.1.9001 (2022-12-24) + +## Chore + +- Use testthat edition 3. + +- Fix CI/CD failures (@IndrajeetPatil, #10, #11). + +## Uncategorized + +- Harmonize yaml formatting. + +- Revert changes to matrix section. + +- Reduce parallelism. + +- Also check dev on cran-* branches. + +- Update hash key for dev. + +- Remove R 3.3. + +- Merge cran-1.1.1. + + # wrswoR 1.1.1.9000 (2020-07-26) - Internal changes only.