Fix Incorrect Regular Expression Matching #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Integration tests" | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "docs/**" | |
- "*.md" | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "*.md" | |
jobs: | |
changes: | |
name: Check for changes | |
runs-on: ubuntu-latest | |
outputs: | |
single_module: ${{ steps.single_module.outputs.value }} | |
steps: | |
- uses: actions/checkout@v4 | |
- 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: "" | |
all_modules_linux: | |
name: Python ${{ matrix.python-version }} | |
runs-on: ubuntu-20.04 | |
needs: changes | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.12"] # Oldest and newest supported Python versions | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install MultiQC | |
run: pip install . | |
- name: Download test data | |
uses: actions/checkout@v4 | |
with: | |
repository: MultiQC/test-data | |
path: test-data | |
- name: All modules / Custom report filename | |
run: multiqc ${{ needs.changes.outputs.single_module }} --strict test-data/data/modules --filename full_report.html | |
specific_cases_linux: | |
name: More variations of flags and inputs | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 10 | |
env: | |
# Typical modules to cover different plot types | |
test_modules: "-m samtools -m fastqc -m somalier -m bcl2fastq -m isoseq" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install MultiQC | |
run: pip install . | |
- name: Download test data | |
uses: actions/checkout@v4 | |
with: | |
repository: MultiQC/test-data | |
path: test-data | |
- name: Special case input data | |
run: multiqc ${{ env.test_modules }} test-data/data --ignore test-data/data/modules/ | |
- name: All modules / Log filename as s_name, no cleaning | |
run: multiqc ${{ env.test_modules }} --strict test-data/data/modules/ --fullnames --fn_as_s_name | |
- name: Filter out all filenames (confirm no report) | |
run: | | |
multiqc ${{ env.test_modules }} 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 ModuleNoSamplesFound when no matching files are found" >&2 | |
exit 1 | |
fi | |
- name: File-list input of dirs | |
run: | | |
cd test-data | |
multiqc ${{ env.test_modules }} --file-list data/special_cases/dir_list.txt | |
- name: Force overwrite / Prepend dirnames / Name and comment / No data dir | |
run: multiqc ${{ env.test_modules }} --strict test-data/data/modules -f -d -dd 1 -i "Forced Report" -b "This command has lots of options" --filename custom_fn --no-data-dir | |
- name: Flat plots / Exclude module / Ignore samples / Full names / zip data dir / config file | |
run: multiqc ${{ env.test_modules }} --strict test-data/data/modules --flat --exclude clusterflow --ignore-samples ngi --fullnames --zip-data-dir -c test-data/config_example.yaml | |
- name: Specific module / named output dir / JSON data / File list | |
run: | | |
cd test-data | |
multiqc ${{ env.test_modules }} -o tests/multiqc_report_dev -k json --file-list data/special_cases/file_list.txt | |
- name: No report | |
run: | | |
cd test-data | |
multiqc ${{ env.test_modules }} data/modules --no-report -n no-report | |
if [[ -f no-report.html ]]; then | |
echo "Running with the --no-report flag should not produce an HTML" >&2 | |
exit 1 | |
fi | |
- name: Empty directory (confirm no report) | |
run: | | |
mkdir empty_dir | |
multiqc ${{ env.test_modules }} empty_dir -n empty | |
if [[ -f empty.html ]]; then | |
echo "Empty directory should not produce a report" >&2 | |
exit 1 | |
fi | |
all_modules_windows: | |
name: Windows | |
runs-on: windows-latest | |
needs: changes | |
timeout-minutes: 10 | |
steps: | |
# Check out MultiQC code | |
- uses: actions/checkout@v4 | |
# 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 }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
# Cache pip packages | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~\AppData\Local\pip\Cache | |
~\AppData\Local\Programs\Python\Python312\Lib\site-packages | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- 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/MultiQC/test-data/archive/main.zip -o test-data.zip | |
7z x test-data.zip -y -o"test-data" | |
dir test-data\test-data-main | |
# Run all of the tests! Remember the BACKslash path separator! | |
- name: All modules / Custom report filename | |
run: | | |
$single_module = "${{ needs.changes.outputs.single_module }}" | |
# want to run on just one module to avoid the windows job to time out: | |
if ($single_module) { | |
multiqc $single_module --strict test-data\test-data-main\data\modules\ --filename full_report.html | |
} | |
if (-not $single_module) { | |
multiqc -m samtools --strict test-data\test-data-main\data\modules\ --filename full_report.html | |
} |