Skip to content

Commit

Permalink
added integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
b-rodrigues committed Jan 7, 2025
1 parent f1c5442 commit 1fbe764
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/test-rix-git_pkgs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Integration tests for installing git packages
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-rix-git_pkgs

permissions:
contents: read

jobs:
devtools:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, 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: Build default.nix with 2 local packages
run: |
nix-shell default.nix --run "Rscript -e \"library(rix);rix('4.4.2', git_pkgs = list(list(package_name = 'lookup', repo_url = 'https://github.com/jimhester/highlite/', commit = '767b122ef47a60a01e1707e4093cf3635a99c86b'), project_path = '.', overwrite = TRUE)\""
- name: Check generated default.nix
run: cat default.nix

- name: Build default.nix
run: nix-build
44 changes: 44 additions & 0 deletions .github/workflows/test-rix-rpkgs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, 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: Build default.nix with 2 local packages
run: |
nix-shell default.nix --run "Rscript -e \"library(rix);rix('4.3.1', r_pkgs = c('dplyr', 'S4Vectors'), project_path = '.', overwrite = TRUE)\""
- name: Check generated default.nix
run: cat default.nix

- name: Build default.nix
run: nix-build
44 changes: 44 additions & 0 deletions .github/workflows/test-rix-rstudio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Integration tests for installing packages wrapped by rstudio
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-rix-rstudio

permissions:
contents: read

jobs:
devtools:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, 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: Build default.nix with 2 local packages
run: |
nix-shell default.nix --run "Rscript -e \"library(rix);rix('4.3.1', r_pkgs = c('dplyr', 'S4Vectors'), ide = 'rstudio', project_path = '.', overwrite = TRUE)\""
- name: Check generated default.nix
run: cat default.nix

- name: Build default.nix
run: nix-build
44 changes: 44 additions & 0 deletions .github/workflows/test-rix-sys-tex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Integration tests for installing tex and system packages
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-rix-sys-tex

permissions:
contents: read

jobs:
devtools:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, 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: Build default.nix with 2 local packages
run: |
nix-shell default.nix --run "Rscript -e \"library(rix);rix('4.4.2', r_pkgs = c('dplyr', 'S4Vectors'), system_pkgs = c('quarto', 'git'), tex_pkgs = c('amsmath', 'orcidlink'), project_path = '.', overwrite = TRUE)\""
- name: Check generated default.nix
run: cat default.nix

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

0 comments on commit 1fbe764

Please sign in to comment.