Skip to content

Commit

Permalink
Merge branch 'master' into fix_fwrite_length
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Dec 3, 2024
2 parents 309da8f + 23dac21 commit 3630413
Show file tree
Hide file tree
Showing 54 changed files with 5,142 additions and 234 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.dir-locals.el
.check.translations.R
^\.Rprofile$
^data\.table_.*\.tar\.gz$
^config\.log$
Expand Down
2 changes: 1 addition & 1 deletion .ci/.lintr.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ exclusions = c(local({
infix_spaces_linter = Inf,
undesirable_function_linter = Inf
)),
exclusion_for_dir("vignettes", list(
exclusion_for_dir(c("vignettes", "vignettes/fr"), list(
quotes_linter = Inf,
sample_int_linter = Inf
# strings_as_factors_linter = Inf
Expand Down
21 changes: 20 additions & 1 deletion .ci/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# data.table continuous integration and deployment

On each Pull Request opened in GitHub we run GitHub Actions test jobs to provide prompt feedback about the status of PR. Our main CI pipeline runs on GitLab CI nightly. GitLab repository automatically mirrors our GitHub repository and runs pipeline on `master` branch every night. It tests more environments and different configurations. It publish variety of artifacts.
On each Pull Request opened in GitHub we run GitHub Actions test jobs to provide prompt feedback about the status of PR. Our more thorough main CI pipeline runs nightly on GitLab CI. GitLab repository automatically mirrors our GitHub repository and runs pipeline on `master` branch every night. It tests more environments and different configurations. It publishes a variety of artifacts such as our [homepage](https://rdatatable.gitlab.io/data.table/) and [CRAN-like website for dev version](https://rdatatable.gitlab.io/data.table/web/packages/data.table/index.html), including windows binaries for the dev version.

## Environments

Expand Down Expand Up @@ -44,3 +44,22 @@ Base R implemented helper script, [originally proposed to base R](https://svn.r-
### [`publish.R`](./publish.R)

Base R implemented helper script to orchestrate generation of most artifacts and to arrange them nicely. It is being used only in [_integration_ stage in GitLab CI pipeline](./../.gitlab-ci.yml).

## GitLab Open Source Program

We are currently part of the [GitLab for Open Source Program](https://about.gitlab.com/solutions/open-source/). This gives us 50,000 compute minutes per month for our GitLab CI. Our license needs to be renewed yearly (around July) and is currently managed by @ben-schwen.

## Updating CI pipeline

Basic CI checks are also run on every push to the GitLab repository. This can **and should** be used for PRs changing the CI pipeline before merging them to master.

```shell
# fetch changes from remote (GitHub) and push them to GitLab
git fetch [email protected]:Rdatatable/data.table.git new_branch:new_branch
git push
# after updating on GitHub, pull changes from remote and push to GitLab
git pull [email protected]:Rdatatable/data.table.git new_branch
git push
```

Make sure to include a link to the pipeline results in your PR.
25 changes: 25 additions & 0 deletions .ci/atime/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@ for (extra.arg in extra.args.6107){
extra.test.list[[sprintf("fread(%s) improved in #6107", extra.arg)]] <- this.test
}

# Test case adapted from https://github.com/Rdatatable/data.table/pull/4386#issue-602528139 which is where the performance was improved.
for(retGrp_chr in c("T","F"))extra.test.list[[sprintf(
"forderv(retGrp=%s) improved in #4386", retGrp_chr
)]] <- list(
setup = quote({
dt <- data.table(group = rep(1:2, l=N))
}),
expr = substitute({
old.opt <- options(datatable.forder.auto.index = TRUE) # required for test, un-documented, comments in forder.c say it is for debugging only.
data.table:::forderv(dt, "group", retGrp = RETGRP)
options(old.opt) # so the option does not affect other tests.
}, list(RETGRP=eval(str2lang(retGrp_chr)))),
## From ?bench::mark, "Each expression will always run at least twice,
## once to measure the memory allocation and store results
## and one or more times to measure timing."
## So for atime(times=10) that means 11 times total.
## First time for memory allocation measurement,
## (also sets the index of dt in this example),
## then 10 more times for time measurement.
## Timings should be constant if the cached index is used (Fast),
## and (log-)linear if the index is re-computed (Slow).
Slow = "b1b1832b0d2d4032b46477d9fe6efb15006664f4", # Parent of the first commit (https://github.com/Rdatatable/data.table/commit/b0efcf59442a7d086c6df17fa6a45c81b082322e) in the PR (https://github.com/Rdatatable/data.table/pull/4386/commits) where the performance was improved.
Fast = "ffe431fbc1fe2d52ed9499f78e7e16eae4d71a93" # Last commit of the PR (https://github.com/Rdatatable/data.table/pull/4386/commits) where the performance was improved.
)

# A list of performance tests.
#
# See documentation in https://github.com/Rdatatable/data.table/wiki/Performance-testing for best practices.
Expand Down
7 changes: 4 additions & 3 deletions .ci/ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ mirror.packages <-
function(pkgs,
which = c("Depends", "Imports", "LinkingTo"),
repos = getOption("repos"),
type = c("source", "mac.binary", "win.binary"),
type = c("source", "mac.binary.big-sur-arm64", "win.binary"),
repodir,
except.repodir = repodir,
except.priority = "base",
Expand Down Expand Up @@ -169,7 +169,8 @@ function(pkgs,
newpkgs <- newpkgs[availpkgs]
}

pkgsext <- switch(type,
typeshort <- if (startsWith(type, "mac.binary.")) "mac.binary" else type
pkgsext <- switch(typeshort,
"source" = "tar.gz",
"mac.binary" = "tgz",
"win.binary" = "zip")
Expand All @@ -181,7 +182,7 @@ function(pkgs,
dp <- utils::download.packages(pkgs = newpkgs, destdir = destdir,
available = db, contriburl = repos.url,
type = type, method = method, quiet = quiet)
tools::write_PACKAGES(dir = destdir, type = type, ...)
tools::write_PACKAGES(dir = destdir, type = typeshort, ...)
dp
}

2 changes: 1 addition & 1 deletion .ci/publish.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ format.bins <- function(ver, bin_ver, cran.home, os.type, pkg, version, repodir)
plat.path = "windows"
} else if (os.type=="macosx") {
ext = "tgz"
plat.path = "macosx/el-capitan"
plat.path = "macosx/big-sur-arm64"
} else stop("format.bins only valid for 'windows' or 'macosx' os.type")
file = sprintf("bin/%s/contrib/%s/%s_%s.%s", plat.path, bin_ver, pkg, version, ext)
fe = file.exists(file.path(repodir, file))
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check-occasional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
echo "LC_ALL=lv_LV.utf8" >> $GITHUB_ENV
echo "LANGUAGE=lv_LV" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -52,7 +52,7 @@ jobs:
shell: Rscript {0}

- name: Restore R package cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
on:
push:
branches:
- master
branches: [master]
pull_request:
branches:
- master

name: code-quality

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: atime performance tests

on:
pull_request:
branches:
- '*'
types:
- opened
- reopened
Expand All @@ -22,4 +20,4 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: Anirban166/Autocomment-atime-results@v1.2.1
- uses: Anirban166/Autocomment-atime-results@v1.4.1
8 changes: 4 additions & 4 deletions .github/workflows/pkgup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
- name: cache-r-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}/*
key: library-cache-${{ github.run_id }}
Expand Down Expand Up @@ -65,10 +65,10 @@ jobs:
Rscript -e 'tools::write_PACKAGES("public/src/contrib", fields="Revision")'
- name: upload
if: github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: "public"
- name: deploy
if: github.ref == 'refs/heads/master'
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
5 changes: 2 additions & 3 deletions .github/workflows/rchk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
# under the License.
on:
push:
branches:
- master
branches: [master]
pull_request:

name: 'rchk'
Expand All @@ -27,7 +26,7 @@ jobs:
rchk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'devel'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [master]
pull_request:
branches: [master]

name: test-coverage.yaml

Expand Down
Loading

0 comments on commit 3630413

Please sign in to comment.