Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches: [ main, test ]
pull_request:
branches: [ main, test ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.5.0'
use-public-rspm: true

- name: Install R system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libxml2-dev libssl-dev

- name: Install R dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::remotes
any::roxygen2
any::testthat
any::devtools

- name: Install qg package
run: |
R CMD INSTALL .
shell: bash

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install nox
run: |
uv tool install nox

- name: Run tests with nox
run: |
cd config_tests
uvx nox -s tests
6 changes: 4 additions & 2 deletions config_tests/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import rpy2.robjects.pandas2ri
from contextlib import contextmanager
from inline_snapshot import snapshot
from pathlib import Path
from rpy2.rinterface_lib.embedded import RRuntimeError
from rpy2.robjects.packages import importr

Expand Down Expand Up @@ -64,8 +65,9 @@ def qg_mod():
# Load devtools if needed
devtools = importr("devtools")

# Load the development version from the specified path
devtools.load_all("/Users/leo/code/qg")
# Load the development version from the qg root
qg_root = Path(__file__).parents[2]
devtools.load_all(str(qg_root))

# Return the loaded module
return importr("qg")