Skip to content

Commit

Permalink
separate r and python; fix r_libs_user
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgigante committed Mar 10, 2021
1 parent e1a89de commit 2faec78
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 19 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ jobs:
with:
fetch-depth: 0

- name: Check Ubuntu version
- name: Set up environment
run: |
echo "UBUNTU_VERSION=`grep DISTRIB_RELEASE /etc/lsb-release | sed 's/.*=//g'`" >> $GITHUB_ENV
mkdir -p .local/R/site-packages
echo "R_LIBS_USER=`pwd`/.local/R/site-packages" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v2
Expand Down
94 changes: 76 additions & 18 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:

run_tester:
test_python:
runs-on: ${{ matrix.config.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"

Expand Down Expand Up @@ -60,14 +60,87 @@ jobs:
nose2 -vvv
cd ..
- name: Build docs
run: |
cd python
pip install .[doc]
cd doc
make html
cd ../..
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
coveralls
- name: Upload check results on fail
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ matrix.config.name }}_results
path: check

test_r:
runs-on: ${{ matrix.config.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"

strategy:
fail-fast: false
matrix:
config:
- {name: 'devel', os: ubuntu-latest, r: 'devel' }
- {name: 'release', os: ubuntu-latest, r: 'release' }
- {name: 'oldrel', os: ubuntu-latest, r: 'oldrel' }

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}

- name: Set up environment
run: |
echo "UBUNTU_VERSION=`grep DISTRIB_RELEASE /etc/lsb-release | sed 's/.*=//g'`" >> $GITHUB_ENV
mkdir -p .local/R/site-packages
echo "R_LIBS_USER=`pwd`/.local/R/site-packages" >> $GITHUB_ENV
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.config.python }}

- name: Cache Python packages
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{runner.os}}-pip-${{ env.pythonLocation }}-${{ hashFiles('python/setup.py') }}
restore-keys: ${{runner.os}}-pip-${{ env.pythonLocation }}-

- name: Install package & dependencies
run: |
python -m pip install --upgrade pip
pip install -U wheel setuptools
pip install -U ./python
python -c "import magic"
- name: Set up R
id: setup-r
uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}

- name: Cache R packages
uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ${{env.R_LIBS_USER}}
key: precommit-${{env.UBUNTU_VERSION}}-renv-${{ hashFiles('.pre-commit.r_requirements.txt') }}-
key: test-${{env.UBUNTU_VERSION}}-renv-${{ steps.setup-r.outputs.installed-r-version }}-${{ hashFiles('Rmagic/DESCRIPTION') }}-
restore-keys: |
precommit-${{env.UBUNTU_VERSION}}-renv-
test-${{env.UBUNTU_VERSION}}-renv-${{ steps.setup-r.outputs.installed-r-version }}-
- name: Install R packages
run: |
Expand All @@ -81,21 +154,6 @@ jobs:
R CMD check --as-cran *.tar.gz
cd ..
- name: Build docs
run: |
cd python
pip install .[doc]
cd doc
make html
cd ../..
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
coveralls
- name: Upload check results on fail
if: failure()
uses: actions/upload-artifact@master
Expand Down

0 comments on commit 2faec78

Please sign in to comment.