From 57705939987ac9571b449d8748e55554c511dcbb Mon Sep 17 00:00:00 2001 From: Fleming Kretschmer Date: Thu, 8 Feb 2024 13:19:37 +0100 Subject: [PATCH] adapted normal preprocessing workflow to work with docker --- .github/workflows/preprocess.yaml | 48 ++++++------------------------- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/.github/workflows/preprocess.yaml b/.github/workflows/preprocess.yaml index b1a810c..d7aafae 100644 --- a/.github/workflows/preprocess.yaml +++ b/.github/workflows/preprocess.yaml @@ -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 @@ -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 }} @@ -117,6 +86,7 @@ jobs: run: | git config --global user.email 'actions@github.com' 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'