Skip to content

New python tests

New python tests #15

Workflow file for this run

name: Python workflow Tests
on:
push:
paths:
- biobb_wf_ligand_parameterization/python/workflow.env.yml
workflow_dispatch:
jobs:
detect-files:
name: Detect Changed Files
runs-on: self-hosted
outputs:
changed_files: ${{ steps.detect_changes.outputs.changed_files }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Detect changed files
id: detect_changes
run: |
git diff --name-only ${{ github.event.before }} ${{ github.sha }} > changed_files.txt
changed_files=$(cat changed_files.txt)
echo "changed_files=$changed_files" >> $GITHUB_ENV
shell: bash
run-jobs:
needs: detect-files
runs-on: self-hosted
strategy:
matrix:
include:
- file: 'biobb_wf_ligand_parameterization/python/workflow.env.yml'
job: 'biobb_wf_ligand_parameterization'
wf_name: 'biobb_wf_ligand_parameterization'
# - file: 'path/to/another/file.yml'
# job: 'another_job'
# wf_name: 'another_workflow'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run conditional job
if: contains(needs.detect-files.outputs.changed_files, 'biobb_wf_ligand_parameterization/python/workflow.env.yml')
uses: ./.github/workflows/common-python.yaml
with:
wf_name: ${{ matrix.wf_name }}
# - name: Check out repository code
# if: contains(needs.detect-files.outputs.changed_files, 'biobb_wf_ligand_parameterization/python/workflow.env.yml')
# uses: actions/checkout@v4
# - run: echo "Repository -> ${{ github.repository }}"
# - run: echo "Branch -> ${{ github.ref }}"
# - run: echo "Trigger event -> ${{ github.event_name }}"
# - run: echo "Runner OS -> ${{ runner.os }}"
# - name: List files in the repository
# run: |
# ls ${{ github.workspace }}
# - name: Remove all micromamba installations
# if: contains(needs.detect-files.outputs.changed_files, 'biobb_wf_ligand_parameterization/python/workflow.env.yml')
# run: |
# rm -rf $HOME/.bash_profile $HOME/.conda $HOME/micromamba $HOME/micromamba-bin 2>/dev/null
# touch $HOME/.bash_profile
# - name: setup-micromamba
# if: contains(needs.detect-files.outputs.changed_files, 'biobb_wf_ligand_parameterization/python/workflow.env.yml')
# uses: mamba-org/[email protected]
# with:
# generate-run-shell: true
# micromamba-version: '2.0.2-2'
# post-cleanup: 'all'
# init-shell: bash
# environment-file: biobb_wf_ligand_parameterization/python/workflow.env.yml
# create-args: >-
# pytest
# - name: List installed package versions
# shell: bash -l {0}
# run: micromamba list
# - name: Run tests
# if: contains(needs.detect-files.outputs.changed_files, 'biobb_wf_ligand_parameterization/python/workflow.env.yml')
# shell: bash -l {0}
# run: |
# export PYTHONPATH=.:./biobb_common:$PYTHONPATH
# cd biobb_wf_ligand_parameterization/tests/python
# # Production one
# pytest biobb_wf_ligand_parameterization.py --config ../../python/workflow.yml --remove