Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize actions #1

Merged
merged 36 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bab63c7
Update
walkowif Jun 27, 2024
f6f9351
Update
walkowif Jun 27, 2024
5324417
update
pawelru Jun 27, 2024
a49b51a
update
pawelru Jun 27, 2024
3aab8a0
Format inputs description
walkowif Jun 27, 2024
005ca60
Fix duplicate job identifiers
walkowif Jun 27, 2024
4081bee
Fix step conditions
walkowif Jun 27, 2024
9e49722
Fix inputs syntax
walkowif Jun 27, 2024
fc444a3
Fix inputs syntax
walkowif Jun 27, 2024
608b378
Set git safe directory
walkowif Jun 27, 2024
90d2596
Make it more visible that scripts run in Rscript shell
walkowif Jun 27, 2024
4f838fd
update
pawelru Jun 27, 2024
0b25107
update
pawelru Jun 27, 2024
f5efc9b
update
pawelru Jun 27, 2024
4df303a
System independent git command
walkowif Jun 27, 2024
0aa44c2
Use GHA to check if we're running for default branch
walkowif Jun 27, 2024
6f945da
Fix
walkowif Jun 27, 2024
aa52eb3
Update
walkowif Jun 27, 2024
2e99e21
Revert "Update"
walkowif Jun 27, 2024
2937bec
Get current branch from GHA
walkowif Jun 27, 2024
feedc30
Update action.yaml
pawelru Jun 27, 2024
abc871e
fix desc_field_append()
pawelru Jun 28, 2024
af9f948
readme
pawelru Jun 28, 2024
e1b2b38
update
pawelru Jun 28, 2024
4ca1e3a
move utils to a separate step
pawelru Jun 28, 2024
156a99d
update
pawelru Jun 28, 2024
6d4f92c
temp debug print
pawelru Jun 28, 2024
be4890f
update
pawelru Jun 28, 2024
135e8fe
cat to print
pawelru Jun 28, 2024
fbca5a7
rm debug
pawelru Jun 28, 2024
a88a3f6
update
pawelru Jul 3, 2024
6792c7a
better secure against infinite loop
pawelru Jul 3, 2024
f518cea
rm R pipe
pawelru Jul 3, 2024
754b0c6
log_vars() to utils
pawelru Jul 3, 2024
b7a8464
add missing parse_input() calls
pawelru Jul 3, 2024
c1bc69d
update
pawelru Jul 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CLA 🔏

on:
issue_comment:
types:
- created
# For PRs that originate from forks
pull_request_target:
types:
- opened
- closed
- synchronize

jobs:
CLA:
name: CLA 📝
uses: insightsengineering/.github/.github/workflows/cla.yaml@main
secrets: inherit
30 changes: 30 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: SuperLinter

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
lint:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Lint Code Base
uses: super-linter/super-linter/slim@v5
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
VALIDATE_R: true
VALIDATE_YAML: true
VALIDATE_BASH_EXEC: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/short-tagging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Keep the versions up-to-date ☕️

on:
release:
types: [published, edited]

jobs:
actions-tagger:
runs-on: ubuntu-latest
steps:
- uses: Actions-R-Us/actions-tagger@latest
with:
publish_latest_tag: true
3 changes: 3 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linters: linters_with_defaults(
line_length_linter(120),
commented_code_linter = NULL)
127 changes: 127 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Setup R Dependencies Action

## Description

A wrapper on [`r-lib/actions/setup-r-dependencies`](https://github.com/r-lib/actions/tree/v2-branch/setup-r-dependencies) with additional features as below:

- Use dependencies from identical feature branch (if exists). This allows to co-develop packages and test them together.
- Use development version of dependencies if specified in the `DESCRIPTION` file. This allows to test packages with dependencies that are not yet released.

This logic requires additional input of package references to check against. Please see the `lookup-refs` parameter description for more details. Currently, only GitHub references are supported.

The implementation relies on the `pkgdepends` package and it is temporarily changing the `DESCRIPTION` file by adding new `Config/Needs/` fields. Then `r-lib/actions/setup-r-dependencies` is called with the `needs` parameter.

## Action type
Composite

## Author
Insights Engineering

## Inputs
* `github-token`:

_Description_: Token with permissions to clone repositories with dependencies.

_Required_: `false`

_Default_: `""`

* `repository-path`:

_Description_: Directory where the R package is located relative to the calling GitHub workflow workspace.

_Required_: `false`

_Default_: `"."`

* `lookup-refs`:

_Description_: List of [package references](https://r-lib.github.io/pkgdepends/reference/pkg_refs.html) to be used for the feature branch. Multiple entries in new lines or separated by commas. Only GitHub references are supported.

_Required_: `false`

_Default_: `""`

* `extra-deps`:

_Description_: List of extra dependencies to check against feature branch existence. Multiple entries in new lines or separated by commas. It allows to control indirect dependencies. This requires an entry in the `lookup-refs` input.

_Required_: `false`

_Default_: `""`

* `dependencies`:

_Description_: Passed to `r-lib/actions/setup-r-dependencies`.

_Required_: `false`

_Default_: `"all"`

* `extra-packages`:

_Description_: Passed to `r-lib/actions/setup-r-dependencies`.

_Required_: `false`

_Default_: `""`

* `needs`:

_Description_: Passed to `r-lib/actions/setup-r-dependencies`. The value will be amended by `DepsBranch` and `DepsDev` values.

_Required_: `false`

_Default_: `""`

* `skip-desc-branch`:

_Description_: Skip branch lookup for dependencies specified in the `DESCRIPTION` file.

_Required_: `false`

_Default_: `false`

* `skip-desc-dev`:

_Description_: Skip development version lookup for dependencies specified in the `DESCRIPTION` file.

_Required_: `false`

_Default_: `false`

* `skip-install`:

_Description_: Skip installation of dependencies.

_Required_: `false`

_Default_: `false`


## Outputs

None

## Usage

```yaml
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup R
uses: r-lib/actions/setup-r@v2

- name: Setup R dependencies
uses: insightsengineering/setup-r-dependencies@v1
with:
github-token: ${{ secrets.REPO_GITHUB_TOKEN }}
lookup-refs: |
test/package1
test/package2
test/package3

- name: Check R package
uses: r-lib/actions/check-r-package@v2
```
Loading
Loading