Fix allow-dirty #755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- 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('${{ runner.temp }}/sawy')" | |
cargo run --manifest-path ./savvy-cli/Cargo.toml -- init ${{ runner.temp }}/sawy | |
cd ${{ runner.temp }}/sawy | |
sed -i '/savvy/ s|".*"|{ path = "${{ github.workspace }}" }|' src/rust/Cargo.toml | |
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: ${{ runner.temp }}/sawy | |
- name: Run Rust tests | |
run: | | |
cargo test --manifest-path ${{ runner.temp }}/sawy/src/rust/Cargo.toml | |
cargo r-test ${{ runner.temp }}/sawy/src/rust |