Skip to content

Commit

Permalink
adapted normal preprocessing workflow to work with docker
Browse files Browse the repository at this point in the history
  • Loading branch information
f-kretschmer committed Feb 8, 2024
1 parent 21fb16a commit 5770593
Showing 1 changed file with 9 additions and 39 deletions.
48 changes: 9 additions & 39 deletions .github/workflows/preprocess.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ on:
jobs:
preprocess:
name: Preprocess raw data
# NOTE: on windows as computing of descriptors has a bug on linux right now
runs-on: windows-2019
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} # needed for pulling R packages from github
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.actor }}/repo_rt_preprocessing:latest
env:
RENV_PATHS_LIBRARY: '/renv/library'
defaults:
run:
shell: bash

steps:
- name: Checkout fork repository
Expand All @@ -36,46 +40,11 @@ jobs:
run: echo "files=$(for f in ${{ steps.files.outputs.all }}; do basename $(dirname $f); done | grep -E '^[0-9]+$' | sort | uniq | tr '\n' ' ')" >> $GITHUB_OUTPUT

- name: List all added files
shell: bash {0}
run: |
for f in ${{ steps.filesfolders.outputs.files }}; do
ls -lh raw_data/$f
done
- name: Pyton dependencies
run: pip install -r scripts/Python/requirements.txt

- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Set RENV_PATHS_ROOT
shell: bash
run: |
echo "RENV_PATHS_ROOT=${{ runner.temp }}/renv" >> $GITHUB_ENV
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
r-version: 4.2.2

- name: Restore Renv package cache
uses: actions/cache@v3
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Activate renv
shell: Rscript {0}
run: |
options(renv.config.mran.enabled = FALSE)
renv::restore()
- name: Standardize compounds
run: Rscript scripts/R_ci/compounds_standardize.R ${{ steps.filesfolders.outputs.files }}

Expand Down Expand Up @@ -117,6 +86,7 @@ jobs:
run: |
git config --global user.email '[email protected]'
git config --global user.name 'Github Actions'
git config --global safe.directory '*'
# Use LFS storage of main repository: no push access to fork LFS storage
# TODO: change once repository is moved
git config lfs.url 'https://github.com/f-kretschmer/pr_test_repo.git/info/lfs'
Expand Down

0 comments on commit 5770593

Please sign in to comment.