Skip to content

test user override with env variable #14

test user override with env variable

test user override with env variable #14

name: Nextflow Test Pipeline Container
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Cache Docker images
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: docker-cache-${{ runner.os }}-${{ hashFiles('**/nextflow.config', '**/modules.config') }}
restore-keys: |
docker-cache-${{ runner.os }}-
- name: Capture runner UID/GID
run: |
echo "UID=$(id -u)" >> $GITHUB_ENV
echo "GID=$(id -g)" >> $GITHUB_ENV
- name: Install Nextflow
run: |
curl -s https://get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
nextflow -version
- name: Run Nextflow pipeline with Docker
env:
NXF_DEFAULT_DOCKER_OPTS: "-u ${{ env.UID }}:${{ env.GID }}"
run: |
nextflow run main.nf -profile test -with-docker
- name: Check test completion and details
run: |
# Check if the test.passed file was created
if [ ! -f "results/test/test.passed" ]; then
echo "ERROR: Test completion file 'results/test/test.passed' not found"
echo "Test pipeline did not complete successfully"
exit 1
fi
echo "✅ Test completed successfully!"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: nextflow-test-results
path: |
results/
.nextflow.log
retention-days: 7