Skip to content

Commit

Permalink
added integration test for renv2nix
Browse files Browse the repository at this point in the history
  • Loading branch information
b-rodrigues committed Jan 9, 2025
1 parent 66e21c9 commit fc70123
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/test-renv2nix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Integration tests for installing packages
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-rix-rpkgs

permissions:
contents: read

jobs:
devtools:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- uses: cachix/cachix-action@v15
with:
name: rstats-on-nix
# If you chose signing key for write access
# signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH }}'

- name: Download test packages
run: |
wget https://raw.githubusercontent.com/ropensci/rix/refs/heads/main/tests/testthat/testdata/renv-samples/renv_datathin.lock
- name: Build default.nix with 2 packages
run: |
nix-shell default.nix --run "Rscript -e \"devtools::load_all();renv2nix(renv_lock_path = 'renv_datathin.lock', override_r_ver = '4.4.2', project_path = '.', message_type = 'quiet', overwrite = TRUE)\""
- name: Check generated default.nix
run: cat default.nix

- name: Build default.nix
run: nix-build

- name: Try running the shell
run: nix-shell --run "echo OK"

0 comments on commit fc70123

Please sign in to comment.