Skip to content

Trying to remove bioconda default channel #60

Trying to remove bioconda default channel

Trying to remove bioconda default channel #60

Workflow file for this run

name: Run tests
on:
pull_request:
branches: [main]
# Cancel if a newer run is started
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
# FIXME Flip this off once we get to less than a couple hundred. Adding
# this so it will only run against changed files. It'll make it much
# easier to fix these as they come up rather than everything at once.
with:
extra_args: ""
prettier:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Install NodeJS
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "20"
- name: Install Prettier
run: npm install -g prettier@3.1.0
- name: Run Prettier --check
run: prettier --check .
editorconfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "20"
- name: Install editorconfig-checker
run: npm install -g editorconfig-checker
- name: Run ECLint check
run: editorconfig-checker -exclude README.md $(git ls-files | grep -v test)
nf-test-changes:
name: nf-test-changes
runs-on: ubuntu-latest
outputs:
# Expose detected tags as 'modules' and 'workflows' output variables
paths: ${{ steps.list.outputs.components }}
modules: ${{ steps.outputs.outputs.modules }}
subworkflows: ${{ steps.outputs.outputs.subworkflows}}
# Prod for version bumping
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: List nf-test files
id: list
uses: gallvp/detect-nf-test-changes@a42129de36ec0491bb2ffdd0e041923d27b09dac # master
with:
head: ${{ github.sha }}
base: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
n_parents: 2
ignored: "nf-core-modules/**"
log_level: "DEBUG"
- name: Separate modules and subworkflows
id: outputs
run: |
echo modules=$(echo '${{ steps.list.outputs.components }}' | jq -c '. | map(select(contains("modules/gallvp/"))) | map(gsub("modules/gallvp/"; ""))') >> $GITHUB_OUTPUT
echo subworkflows=$(echo '${{ steps.list.outputs.components }}' | jq '. | map(select(contains("subworkflows/gallvp/"))) | map(gsub("subworkflows/gallvp/"; ""))') >> $GITHUB_OUTPUT
- name: debug
run: |
echo ${{ steps.list.outputs.components }}
echo ${{ steps.outputs.outputs.modules }}
echo ${{ steps.outputs.outputs.subworkflows }}
nf-core-lint-modules:
runs-on: ubuntu-latest
name: nf-core-lint-modules
needs: [nf-test-changes]
if: ${{ needs.nf-test-changes.outputs.modules != '[]' }}
strategy:
fail-fast: false
matrix:
tags: ["${{ fromJson(needs.nf-test-changes.outputs.modules) }}"]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
with:
python-version: "3.11"
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
id: cache-pip
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
restore-keys: |
${{ runner.os }}-pip
- name: Install pip
run: python -m pip install --upgrade pip
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4
with:
distribution: "temurin"
java-version: "17"
- name: Setup Nextflow
uses: nf-core/setup-nextflow@v2
- name: Install nf-core tools development version
run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev
- name: Lint module ${{ matrix.tags }}
run: nf-core modules -g https://github.com/GallVp/nxf-components.git lint ${{ matrix.tags }}
nf-core-lint-subworkflows:
runs-on: ubuntu-latest
name: nf-core-lint-modules
needs: [nf-test-changes]
if: ${{ needs.nf-test-changes.outputs.subworkflows != '[]' }}
strategy:
fail-fast: false
matrix:
tags: ["${{ fromJson(needs.nf-test-changes.outputs.subworkflows) }}"]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
with:
python-version: "3.11"
- name: Install pip
run: python -m pip install --upgrade pip
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4
with:
distribution: "temurin"
java-version: "17"
- name: Setup Nextflow
uses: nf-core/setup-nextflow@561fcfc7146dcb12e3871909b635ab092a781f34 # v2
- name: Install nf-core tools development version
run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev
- name: Lint module ${{ matrix.tags }}
run: nf-core subworkflows lint ${{ matrix.tags }}
nf-test:
runs-on: ubuntu-latest
name: nf-test
needs: [nf-test-changes]
if: ( needs.nf-test-changes.outputs.paths != '[]' )
strategy:
fail-fast: false
matrix:
path: ["${{ fromJson(needs.nf-test-changes.outputs.paths) }}"]
profile: [conda, docker, singularity]
exclude:
- profile: conda
path: modules/gallvp/braker3
- profile: conda
path: modules/gallvp/edta/edta
- profile: conda
path: subworkflows/gallvp/fasta_edta_lai
env:
NXF_ANSI_LOG: false
NFTEST_VER: "0.9.0"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4
with:
distribution: "temurin"
java-version: "17"
- name: Setup Nextflow
uses: nf-core/setup-nextflow@v2
- name: Install nf-test
uses: nf-core/setup-nf-test@v1
- name: Setup apptainer
if: matrix.profile == 'singularity'
uses: eWaterCycle/setup-apptainer@main
- name: Set up Singularity
if: matrix.profile == 'singularity'
run: |
mkdir -p $NXF_SINGULARITY_CACHEDIR
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
with:
python-version: "3.11"
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
id: cache-pip-pdiff
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-pdiff
restore-keys: |
${{ runner.os }}-pip-pdiff
- name: Install Python dependencies
run: python -m pip install --upgrade pip pdiff cryptography
- name: Set up miniconda
if: matrix.profile == 'conda'
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3
with:
miniconda-version: "latest"
auto-update-conda: true
channels: conda-forge,bioconda,defaults
- name: Conda setup
if: matrix.profile == 'conda'
run: |
conda clean -a
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
echo $(realpath $CONDA)/condabin >> $GITHUB_PATH
echo $(realpath python) >> $GITHUB_PATH
# Test the module
- name: Run nf-test
env:
NFT_DIFF: "pdiff"
NFT_DIFF_ARGS: "--line-numbers --width 120 --expand-tabs=2"
run: |
PROFILE=${{ matrix.profile }}
NFT_WORKDIR=~ \
nf-test test \
--profile=${{ matrix.profile }} \
--tap=test.tap \
--verbose \
${{ matrix.path }}
- uses: pcolby/tap-summary@0959cbe1d4422e62afc65778cdaea6716c41d936 # v1
with:
path: >-
test.tap
- name: Clean up
if: always()
run: |
sudo rm -rf /home/ubuntu/tests/
confirm-pass:
runs-on: ubuntu-latest
needs:
[pre-commit, prettier, editorconfig, nf-core-lint-modules, nf-core-lint-subworkflows, nf-test-changes, nf-test]
if: always()
steps:
- name: All tests ok
if: ${{ success() || !contains(needs.*.result, 'failure') }}
run: exit 0
- name: One or more tests failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
- name: debug-print
if: always()
run: |
echo "toJSON(needs) = ${{ toJSON(needs) }}"
echo "toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}"