Skip to content

Do not add changelog if chore or docs #126

Do not add changelog if chore or docs

Do not add changelog if chore or docs #126

Workflow file for this run

name: "MultiQC"
on:
push:
branches:
- master
paths-ignore:
- "docs/**"
- "*.md"
pull_request:
paths-ignore:
- "docs/**"
- "*.md"
env:
# To reduce code duplication between Win and Linux jobs
core_python_dependencies: "pip setuptools beautifulsoup4"
# No need to run test variations across all Python versions
latest_python: "3.11"
jobs:
changes:
name: Check for changes
runs-on: ubuntu-latest
outputs:
single_module: ${{ steps.single_module.outputs.value }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
modules:
- "multiqc/modules/**"
base_module:
- "multiqc/modules/base_module.py"
changelog:
- "CHANGELOG.md"
all_files:
- "**"
# Set the `-m` flag if only one module has changed
- name: "Get a `-m` flag for the `multiqc` if only one module has changed"
uses: haya14busa/action-cond@v1
id: single_module
with:
cond: ${{ ! steps.filter.outputs.changes.base_module && steps.filter.outputs.changes.n_modules == 1 && (steps.filter.outputs.changes.n_files_changes == 1 || steps.filter.outputs.changes.n_files_changes == 2 && steps.filter.outputs.changes.changelog)}}
if_true: "-m ${{ steps.filter.outputs.changes.modules[0] }}"
if_false: ""
run_linux:
name: Linux - Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
needs: changes
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
timeout-minutes: 10
steps:
- name: Check out MultiQC code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
# For CSP checking
- name: Install dependencies for CI tests
run: python -m pip install --upgrade ${{ env.core_python_dependencies }}
- name: Install MultiQC
run: pip install .
- name: Download test data
uses: actions/checkout@v3
with:
repository: ewels/MultiQC_TestData
path: test_data
# Run all of the tests!
- name: All modules / Custom report filename
run: multiqc ${{ needs.changes.outputs.single_module }} --lint test_data/data/modules/ --filename full_report.html
# More variations of command line flags and inputs. No need to run those across all Python versions.
- name: Special case input data
if: matrix.python-version == env.latest_python
run: multiqc ${{ needs.changes.outputs.single_module }} test_data/data --ignore test_data/data/modules/
- name: All modules / Log filename as s_name, no cleaning
if: matrix.python-version == env.latest_python
run: multiqc ${{ needs.changes.outputs.single_module }} --lint test_data/data/modules/ --fullnames --fn_as_s_name
- name: Filter out all filenames (confirm no report)
if: matrix.python-version == env.latest_python
run: |
multiqc ${{ needs.changes.outputs.single_module }} test_data/data/modules/ --filename all_ignored.html --ignore-samples '*'
if [[ -f all_ignored.html ]]; then
echo "No report should have been generated! Likely due to a module missing self.ignore_samples() or UserWarning when no matching files are found" >&2
exit 1
fi
- name: File-list input of dirs
if: matrix.python-version == env.latest_python
run: |
cd test_data
multiqc ${{ needs.changes.outputs.single_module }} --file-list data/special_cases/dir_list.txt
- name: Specific module / Force overwrite / Prepend dirnames / Name and comment / No data dir
if: matrix.python-version == env.latest_python
run: multiqc --lint test_data/data/modules/ -m fastqc -f -d -dd 1 -i "Forced Report" -b "This command has lots of options" --filename custom_fn --no-data-dir
- name: For overwrite / Flat plots / Tagged modules only / Exclude module / Ignore samples / Full names / zip data dir / config file
if: matrix.python-version == env.latest_python
run: multiqc ${{ needs.changes.outputs.single_module }} --lint test_data/data/modules/ -f --flat --tag methylation --exclude clusterflow --ignore-samples ngi --fullnames --zip-data-dir -c test/config_example.yaml
- name: Specific module / named output dir / dev template / JSON data / File list
if: matrix.python-version == env.latest_python
run: |
cd test_data
multiqc -m star -o tests/multiqc_report_dev -t default_dev -k json --file-list data/special_cases/file_list.txt
- name: Empty directory (confirm no report)
if: matrix.python-version == env.latest_python
run: |
mkdir empty_dir
multiqc -n empty empty_dir ${{ needs.changes.outputs.single_module }}
if [[ -f empty.html ]]; then
echo "Empty directory should not produce a report" >&2
exit 1
fi
- name: Test for missing CSPs
if: matrix.python-version == env.latest_python
run: python test/print_missing_csp.py --report full_report.html --whitelist CSP.txt
run_windows:
name: Windows
runs-on: windows-latest
needs: changes
timeout-minutes: 10
steps:
# Check out MultiQC code
- uses: actions/checkout@v3
# Set up Windows with C++ for numpy
- name: Visual Studio Command Prompt tool
run: cmd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.platform-vcvars }}
# Set up Python
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
# Update core packages
- name: Install dependencies for CI tests
run: python -m pip install --upgrade ${{ env.core_python_dependencies }}
# Install MultiQC
- name: Install MultiQC
run: pip install .
# Fetch the MultiQC test data
# NB: Download zip file instead of git clone, as Windows complains about reserved filenames and certain characters
- name: Download test data
run: |
curl -fsSL https://github.com/ewels/MultiQC_TestData/archive/master.zip -o test_data.zip
7z x test_data.zip -y -o"test_data"
dir test_data\MultiQC_TestData-master
# Run all of the tests! Remember the BACKslash path separator!
- name: All modules / Custom report filename
run: multiqc ${{ needs.changes.outputs.single_module }} --lint test_data\MultiQC_TestData-master\data\modules\ --filename full_report.html