Skip to content

Commit 0b076cb

Browse files
authored
Merge branch 'devel' into scripts/localhost_shebang_fix
2 parents 382631a + 934dffc commit 0b076cb

40 files changed

+882
-450
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
"customizations": {
88
"vscode": {
99
"settings": {
10+
"editor.tabSize": 8,
11+
"editor.indentSize": 4,
12+
"editor.detectIndentation": false,
1013
"r.lsp.diagnostics": false,
1114
"r.plot.useHttpgd": true,
1215
"r.rpath.linux": "/usr/bin/R",
1316
"r.rterm.linux": "/usr/bin/R",
1417
"terminal.integrated.sendKeybindingsToShell": true,
1518
"svn.multipleFolders.enabled": true,
16-
"workbench.editorAssociations": {
19+
"workbench.editorAssociations": {
1720
"*.md": "vscode.markdown.preview.editor"
1821
},
1922
"workbench.welcomePage.walkthroughs.openOnInstall": false

.github/ISSUE_TEMPLATE/release-new-version-of-devcontainer.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ assignees: ''
99

1010
Checklist for release:
1111

12-
- [ ] Update NEWS file
13-
- [ ] Update CITATION.cff
14-
- [ ] Update VERSION
15-
- [ ] In devcontainer.json, update `"image": "ghcr.io/r-devel/r-dev-env:devel"` to `"image": "ghcr.io/r-devel/r-dev-env:main"`,,
16-
- [ ] Make PR to main branch - needs approving review!
17-
- [ ] Make sure docker container is rebuilt
18-
- [ ] Test container and fix any issues
19-
- [ ] Make GitHub release
20-
- [ ] Rebuild docs
12+
- [ ] Update NEWS file
13+
- [ ] Update CITATION.cff
14+
- [ ] Update VERSION
15+
- [ ] In devcontainer.json, update `"image": "ghcr.io/r-devel/r-dev-env:devel"`
16+
to `"image": "ghcr.io/r-devel/r-dev-env:main"`,,
17+
- [ ] Make PR to main branch - needs approving review!
18+
- [ ] Make sure docker container is rebuilt
19+
- [ ] Test container and fix any issues
20+
- [ ] Make GitHub release

.github/README.md

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,76 @@
11
# R Dev Container
2-
![Release](https://img.shields.io/github/v/release/r-devel/r-dev-env)
32

3+
![Release](https://img.shields.io/github/v/release/r-devel/r-dev-env)
44

5-
The aim of the R Dev Container is to provide a standard environment for the exploration and development of the R source code. A prototype was developed under Google Summer of Code 2023 and development is continuing under Google Summer of Code 2024.
5+
The aim of the R Dev Container is to provide a standard environment for the
6+
exploration and development of the R source code. A prototype was developed
7+
under Google Summer of Code 2023 and development is continuing under Google
8+
Summer of Code 2024.
69

710
## Getting started
811

912
### Run in a web browser with GitHub Codespace
1013

11-
Click on the button below followed by "Create Codespace" to create and enter your own web based containerised develoment environment.
14+
Click on the button below followed by "Create Codespace" to create and enter
15+
your own web based containerised develoment environment.
16+
17+
[![Open in GitHub
18+
Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=647768262&machine=premiumLinux&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)
1219

13-
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=647768262&machine=premiumLinux&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)
20+
The [Starting Codespace
21+
section](https://contributor.r-project.org/r-dev-env/container_setup/github_codespace/creating_codespace/)
22+
of the R Dev Container Docs will walk you through the process. Then you can work
23+
through the tutorials in the docs to lean how to use the codespace for R
24+
development.
1425

15-
The [Starting Codespace section](https://contributor.r-project.org/r-dev-env/container_setup/creating_codespace/) of the R Dev Container Docs will walk you through the process. Then you can work through the tutorials in the docs to lean how to use the codespace for R development.
26+
More details about GitHub codespaces can be found in the [GitHub Codespaces
27+
Docs](https://docs.github.com/en/codespaces/overview). GitHub currently offers
28+
up to 60 hours for free on dual core codespaces.
1629

17-
More details about GitHub codespaces can be found in the [GitHub Codespaces Docs](https://docs.github.com/en/codespaces/overview). GitHub currently offers up to 60 hours for free on dual core codespaces.
30+
[![Open in Gitpod](https://img.shields.io/badge/Gitpod-Open%20in%20Gitpod-blue?logo=gitpod&style=for-the-badge)](https://gitpod.io/github.com/r-devel/r-dev-env/tree/main)
31+
32+
The [Starting Gitpod
33+
section](https://contributor.r-project.org/r-dev-env/container_setup/gitpod_workspace/workspacestart/)
34+
of the R Dev Container Docs will walk you through the process. Then you can
35+
work through the tutorials in the docs to lean how to use the codespace for R
36+
development.
37+
38+
More details about Gitpod Workspaces can be found in the
39+
[Gitpod Workspace Docs](https://www.gitpod.io/docs/introduction). Gitpod
40+
currently offers Up to 896 cores, 12,000 GB RAM & GPUs in free tier.
1841

1942
### Run on your local computer
2043

21-
The R Dev Container can also be run locally on your computer.
22-
Running the environment requires you to have Docker, VSCode, and the VSCode Dev Containers extension installed.
23-
Upon opening a copy of the [r-dev-env repository](https://github.com/r-devel/r-dev-env) in VSCode you will be prompted to start the dev container.
44+
The R Dev Container can also be run locally on your computer. Running the
45+
environment requires you to have Docker, VSCode, and the VSCode Dev Containers
46+
extension installed. Upon opening a copy of the [r-dev-env
47+
repository](https://github.com/r-devel/r-dev-env) in VSCode you will be prompted
48+
to start the dev container.
2449

25-
The [Local setup section](https://contributor.r-project.org/r-dev-env/tutorials/localsetup/) of the R Dev Container Docs will walk you through the process.
26-
Then you can work through the following the tutorials in the docs to learn how to use the codespace for R development.
50+
The [Local setup
51+
section](https://contributor.r-project.org/r-dev-env/container_setup/local_setup/localsetup/)
52+
of the R Dev Container Docs will walk you through the process. Then you can
53+
work through the following the tutorials in the docs to learn how to use the
54+
codespace for R development.
2755

28-
More information about Dev Containers can be found in the [Microsoft Documentation](https://code.visualstudio.com/docs/devcontainers/containers).
56+
More information about Dev Containers can be found in the [Microsoft
57+
Documentation](https://code.visualstudio.com/docs/devcontainers/containers).
2958

3059
## Project Background
3160

32-
The standard development process used by members of the R Core Team involves an iterative process of making changes to the source code, re-building R and exploring/testing the changes made.
33-
This process presents a big hurdle for new contributors to R, as setting up their system to build R can be non-trivial, requiring a lot of trouble-shooting, especially on Windows and macOS.
34-
On Linux and macOS, it is not straight-forward to work with different versions of R side-by-side and care needs to be taken not to corrupt or over-write the user's existing version of R/R packages.
35-
36-
For these reasons, we propose to create containerized development environments for R.
37-
Our focus will be on creating a complete environment, including an IDE, that will provide a familiar space for R developers to work on contributions to base R.
61+
The standard development process used by members of the R Core Team involves an
62+
iterative process of making changes to the source code, re-building R and
63+
exploring/testing the changes made. This process presents a big hurdle for new
64+
contributors to R, as setting up their system to build R can be non-trivial,
65+
requiring a lot of trouble-shooting, especially on Windows and macOS. On Linux
66+
and macOS, it is not straight-forward to work with different versions of R
67+
side-by-side and care needs to be taken not to corrupt or over-write the user's
68+
existing version of R/R packages.
69+
70+
For these reasons, we propose to create containerized development environments
71+
for R. Our focus will be on creating a complete environment, including an IDE,
72+
that will provide a familiar space for R developers to work on contributions to
73+
base R.
3874

3975
## Contributors
4076

.github/workflows/build-and-publish-image.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# This workflow uses actions that are not certified by GitHub.
1+
# This workflow uses actions that are not certified by GitHub.
22
# They are provided by a third-party and are governed by
33
# separate terms of service, privacy policy, and support
4-
# documentation.
4+
# documentation.
55

66
name: Build and publish Docker image
77

@@ -15,19 +15,21 @@ on:
1515
- 'Dockerfile'
1616
- 'reinstall-cmake.sh'
1717
- 'VERSION'
18-
18+
19+
permissions:
20+
contents: read
21+
packages: write
1922

2023
env:
2124
REGISTRY: ghcr.io
2225
IMAGE_NAME: ${{ github.repository }}
2326

2427
jobs:
2528
build-and-push-image:
26-
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
29+
if: |
30+
github.event_name == 'workflow_dispatch' ||
31+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true)
2732
runs-on: ubuntu-latest
28-
permissions:
29-
contents: read
30-
packages: write
3133

3234
steps:
3335
- name: Checkout repository

.github/workflows/build-gitpod-image.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# This workflow uses actions that are not certified by GitHub.
1+
# This workflow uses actions that are not certified by GitHub.
22
# They are provided by a third-party and are governed by
33
# separate terms of service, privacy policy, and support
4-
# documentation.
4+
# documentation.
55

66
name: Build and publish Gitpod Docker image
77

@@ -16,19 +16,21 @@ on:
1616
- '.gitpod.yml'
1717
- 'reinstall-cmake.sh'
1818
- 'VERSION'
19-
19+
20+
permissions:
21+
contents: read
22+
packages: write
2023

2124
env:
2225
REGISTRY: ghcr.io
2326
IMAGE_NAME: ${{ github.repository }}
2427

2528
jobs:
2629
build-and-push-image:
27-
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
30+
if: |
31+
github.event_name == 'workflow_dispatch' ||
32+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true)
2833
runs-on: ubuntu-latest
29-
permissions:
30-
contents: read
31-
packages: write
3234

3335
steps:
3436
- name: Checkout repository

.github/workflows/build-mkdocs-website.yml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,58 @@ on:
1212

1313
jobs:
1414
build-and-deploy:
15-
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
15+
if: |
16+
github.event_name == 'workflow_dispatch' ||
17+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true)
1618
runs-on: ubuntu-latest
1719
permissions:
1820
contents: write
1921

2022
steps:
2123
- name: Checkout repository
22-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2325

2426
- name: Set up Python
25-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v5
2628
with:
27-
python-version: 3.x
29+
python-version: 3.x
2830

2931
- name: Install dependencies
3032
run: pip install mkdocs mkdocs-material[imaging]
3133

34+
- name: Determine deployment settings
35+
id: config
36+
run: |
37+
if [[ "${{ github.ref_name }}" == "main" ]]; then
38+
echo "target_repo=${{ github.repository }}" >> "$GITHUB_OUTPUT"
39+
echo "url=https://contributor.r-project.org/r-dev-env" >> "$GITHUB_OUTPUT"
40+
else
41+
echo "target_repo=r-devel/r-dev-env-devel" >> "$GITHUB_OUTPUT"
42+
echo "url=https://contributor.r-project.org/r-dev-env-devel" >> "$GITHUB_OUTPUT"
43+
fi
44+
45+
- name: Modify site_url in mkdocs.yml
46+
run: |
47+
echo "Setting site_url to ${{ steps.config.outputs.url }}"
48+
sed -i "s|^site_url:.*|site_url: '${{ steps.config.outputs.url }}'|" mkdocs.yml
49+
3250
- name: Build MkDocs
3351
run: mkdocs build
3452

35-
- name: Deploy to GitHub Pages
53+
- name: Validate PAT
54+
env:
55+
GH_PAT: ${{ secrets.R_DEV_ENV_DOCS }}
3656
run: |
37-
mkdocs gh-deploy --force
38-
git push origin gh-pages
57+
curl -H "Authorization: token $GH_PAT" https://api.github.com/user || {
58+
echo "PAT is invalid or expired" >&2
59+
exit 1
60+
}
61+
62+
- name: Deploy to GitHub Pages
3963
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
GH_PAT: ${{ secrets.R_DEV_ENV_DOCS }}
65+
run: |
66+
echo "Deploying from branch: ${{ github.ref_name }}"
67+
echo "Commit: ${{ github.sha }}"
68+
git remote set-url origin https://x-access-token:${GH_PAT}@github.com/${{ steps.config.outputs.target_repo }}
69+
mkdocs gh-deploy --config-file mkdocs.yml --remote-branch gh-pages --force

.github/workflows/optimize-docs-images.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Optimize Docs Images
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
branches: ["main","devel"]
67
types: [closed]
@@ -9,7 +10,9 @@ on:
910

1011
jobs:
1112
optimize-images:
12-
if: ${{github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true}}
13+
if: |
14+
github.event_name == 'workflow_dispatch' ||
15+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true)
1316
runs-on: ubuntu-latest
1417

1518
steps:

.github/workflows/schedule-docker-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
schedule:
55
- cron: '0 0 1,15 * *'
66

7+
permissions:
8+
contents: read
9+
packages: write
710

811
env:
912
REGISTRY: ghcr.io
@@ -12,9 +15,6 @@ env:
1215
jobs:
1316
build-and-push-image:
1417
runs-on: ubuntu-latest
15-
permissions:
16-
contents: read
17-
packages: write
1818
strategy:
1919
matrix:
2020
branch: [main, devel]

.markdownlint-cli2.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
config:
2+
3+
# MD013 - line-length
4+
line_length:
5+
line_length: 80
6+
code_blocks: false
7+
tables: false
8+
html:
9+
allowed_elements:
10+
- div
11+
- figure
12+
# MD029 - ol-prefix disabled as ordered lists are interspersed wit code in multiple places
13+
ol-prefix: false
14+
# MD041 - first-line-heading disable due to splitting of sections across multiple files
15+
first-line-h1: false
16+
17+
globs:
18+
19+
- "docs/**/*.md"
20+
- "*.md"
21+
22+
23+
fix: true

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v5.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
12+
- repo: https://github.com/DavidAnson/markdownlint-cli2
13+
rev: v0.18.1
14+
hooks:
15+
- id: markdownlint-cli2
16+
args: []
17+
18+
ci:
19+
autofix_prs: true
20+
autofix_commit_msg: '[pre-commit.ci] Fixing issues with pre-commit'
21+
autoupdate_schedule: weekly
22+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit-autoupdate'
23+
skip: [] # Optionally list ids of hooks to skip on CI

0 commit comments

Comments
 (0)