Skip to content

Commit

Permalink
Test pakage generation (#24)
Browse files Browse the repository at this point in the history
* Test pakage generation

* Tweak

* Tweak

* Fix a mistake

* Install devtools
  • Loading branch information
yutannihilation authored Sep 21, 2023
1 parent 442250d commit eb4dd6f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
if: matrix.config.rust == 'nightly'

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/generate_pkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: Generate R package using savvy

jobs:
generate_pkg:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly
if: matrix.config.rust == 'nightly'

- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::rcmdcheck
any::devtools
any::usethis
working-directory: R-package # this isn't the actual R package, but this is needed to avoid an error

- name: create tempdir
run: echo "TEMP_DIR=$(mktemp -d)" >> ${GITHUB_ENV}

- name: create package
run: |
Rscript -e "usethis::create_package('${{ env.TEMP_DIR }}/sawy')"
cargo run --manifest-path ./savvy-cli/Cargo.toml -- init ${{ env.TEMP_DIR }}/sawy
cd ${{ env.TEMP_DIR }}/sawy
Rscript -e "usethis::use_mit_license('foo')"
Rscript -e "devtools::document()"
- uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual")'
working-directory: ${{ env.TEMP_DIR}}/sawy

0 comments on commit eb4dd6f

Please sign in to comment.