-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from nf-core/dev
First release PR
- Loading branch information
Showing
125 changed files
with
5,324 additions
and
472 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,124 @@ | ||
name: nf-core CI | ||
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors | ||
name: nf-core CI | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
pull_request: | ||
release: | ||
types: [published] | ||
merge_group: | ||
types: | ||
- checks_requested | ||
branches: | ||
- master | ||
- dev | ||
|
||
env: | ||
NXF_ANSI_LOG: false | ||
NFT_VER: "0.8.3" | ||
NFT_WORKDIR: "~" | ||
NFT_DIFF: "pdiff" | ||
NFT_DIFF_ARGS: "--line-numbers --expand-tabs=2" | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
changes: | ||
name: Check for changes | ||
runs-on: ubuntu-latest | ||
outputs: | ||
# Expose matched filters as job 'tags' output variable | ||
tags: ${{ steps.filter.outputs.changes }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Combine all tags.yml files | ||
id: get_username | ||
run: find . -name "tags.yml" -not -path "./.github/*" -exec cat {} + > .github/tags.yml | ||
- name: debug | ||
run: cat .github/tags.yml | ||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: ".github/tags.yml" | ||
|
||
define_nxf_versions: | ||
name: Choose nextflow versions to test against depending on target branch | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.nxf_versions.outputs.matrix }} | ||
steps: | ||
- id: nxf_versions | ||
run: | | ||
if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.base_ref }}" == "dev" && "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then | ||
echo matrix='["latest-everything"]' | tee -a $GITHUB_OUTPUT | ||
else | ||
echo matrix='["latest-everything", "23.04.0"]' | tee -a $GITHUB_OUTPUT | ||
fi | ||
test: | ||
name: Run pipeline with test data | ||
# Only run on push if this is the nf-core dev branch (merged PRs) | ||
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/readsimulator') }}" | ||
name: ${{ matrix.tags }} ${{ matrix.profile }} NF ${{ matrix.NXF_VER }} | ||
needs: [changes, define_nxf_versions] | ||
if: needs.changes.outputs.tags != '[]' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
NXF_VER: | ||
- "23.04.0" | ||
- "latest-everything" | ||
NXF_VER: ${{ fromJson(needs.define_nxf_versions.outputs.matrix) }} | ||
tags: ["${{ fromJson(needs.changes.outputs.tags) }}"] | ||
profile: | ||
- "docker" | ||
|
||
steps: | ||
- name: Check out pipeline code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Nextflow | ||
uses: nf-core/setup-nextflow@v1 | ||
with: | ||
version: "${{ matrix.NXF_VER }}" | ||
|
||
- name: Run pipeline with test data | ||
# TODO nf-core: You can customise CI pipeline run tests as required | ||
# For example: adding multiple test runs with different parameters | ||
# Remember that you can parallelise this by using strategy.matrix | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
architecture: "x64" | ||
|
||
- name: Install pdiff to see diff between nf-test snapshots | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pdiff | ||
- name: Cache nf-test installation | ||
id: cache-software | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
/usr/local/bin/nf-test | ||
/home/runner/.nf-test/nf-test.jar | ||
key: ${{ runner.os }}-${{ env.NFT_VER }}-nftest | ||
|
||
- name: Install nf-test | ||
if: steps.cache-software.outputs.cache-hit != 'true' | ||
run: | | ||
wget -qO- https://code.askimed.com/install/nf-test | bash | ||
sudo mv nf-test /usr/local/bin/ | ||
- name: Run nf-test | ||
run: | | ||
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results | ||
nf-test test --verbose --tag ${{ matrix.tags }} --profile test,"${{ matrix.profile }}" --junitxml=test.xml --tap=test.tap | ||
- uses: pcolby/tap-summary@v1 | ||
with: | ||
path: >- | ||
test.tap | ||
- name: Output log on failure | ||
if: failure() | ||
run: | | ||
sudo apt install bat > /dev/null | ||
batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/meta/nextflow.log | ||
- name: Publish Test Report | ||
uses: mikepenz/action-junit-report@v3 | ||
if: always() # always run even if the previous step fails | ||
with: | ||
report_paths: test.xml |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Test successful pipeline download with 'nf-core download' | ||
|
||
# Run the workflow when: | ||
# - dispatched manually | ||
# - when a PR is opened or reopened to master branch | ||
# - the head branch of the pull request is updated, i.e. if fixes for a release are pushed last minute to dev. | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- opened | ||
branches: | ||
- master | ||
pull_request_target: | ||
branches: | ||
- master | ||
|
||
env: | ||
NXF_ANSI_LOG: false | ||
|
||
jobs: | ||
download: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Nextflow | ||
uses: nf-core/setup-nextflow@v1 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
architecture: "x64" | ||
- uses: eWaterCycle/setup-singularity@v7 | ||
with: | ||
singularity-version: 3.8.3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install git+https://github.com/nf-core/tools.git@dev | ||
- name: Get the repository name and current branch set as environment variable | ||
run: | | ||
echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} | ||
echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV} | ||
echo "REPO_BRANCH=${GITHUB_REF#refs/heads/}" >> ${GITHUB_ENV} | ||
- name: Download the pipeline | ||
env: | ||
NXF_SINGULARITY_CACHEDIR: ./ | ||
run: | | ||
nf-core download ${{ env.REPO_LOWERCASE }} \ | ||
--revision ${{ env.REPO_BRANCH }} \ | ||
--outdir ./${{ env.REPOTITLE_LOWERCASE }} \ | ||
--compress "none" \ | ||
--container-system 'singularity' \ | ||
--container-library "quay.io" -l "docker.io" -l "ghcr.io" \ | ||
--container-cache-utilisation 'amend' \ | ||
--download-configuration | ||
- name: Inspect download | ||
run: tree ./${{ env.REPOTITLE_LOWERCASE }} | ||
|
||
- name: Run the downloaded pipeline | ||
env: | ||
NXF_SINGULARITY_CACHEDIR: ./ | ||
NXF_SINGULARITY_HOME_MOUNT: true | ||
run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
fix-linting: | ||
# Only run if comment is on a PR with the main repo, and if it contains the magic keywords | ||
if: > | ||
contains(github.event.comment.html_url, '/pull/') && | ||
|
@@ -13,43 +13,77 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
# Use the @nf-core-bot token to check out so we can push later | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
with: | ||
token: ${{ secrets.nf_core_bot_auth_token }} | ||
|
||
# indication that the linting is being fixed | ||
- name: React on comment | ||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
reactions: eyes | ||
|
||
# Action runs on the issue comment, so we don't get the PR by default | ||
# Use the gh cli to check out the PR | ||
- name: Checkout Pull Request | ||
run: gh pr checkout ${{ github.event.issue.number }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }} | ||
|
||
- uses: actions/setup-node@v3 | ||
# Install and run pre-commit | ||
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install Prettier | ||
run: npm install -g prettier @prettier/plugin-php | ||
- name: Install pre-commit | ||
run: pip install pre-commit | ||
|
||
# Check that we actually need to fix something | ||
- name: Run 'prettier --check' | ||
id: prettier_status | ||
run: | | ||
if prettier --check ${GITHUB_WORKSPACE}; then | ||
echo "result=pass" >> $GITHUB_OUTPUT | ||
else | ||
echo "result=fail" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Run pre-commit | ||
id: pre-commit | ||
run: pre-commit run --all-files | ||
continue-on-error: true | ||
|
||
- name: Run 'prettier --write' | ||
if: steps.prettier_status.outputs.result == 'fail' | ||
run: prettier --write ${GITHUB_WORKSPACE} | ||
# indication that the linting has finished | ||
- name: react if linting finished succesfully | ||
if: steps.pre-commit.outcome == 'success' | ||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
reactions: "+1" | ||
|
||
- name: Commit & push changes | ||
if: steps.prettier_status.outputs.result == 'fail' | ||
id: commit-and-push | ||
if: steps.pre-commit.outcome == 'failure' | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "nf-core-bot" | ||
git config push.default upstream | ||
git add . | ||
git status | ||
git commit -m "[automated] Fix linting with Prettier" | ||
git commit -m "[automated] Fix code linting" | ||
git push | ||
- name: react if linting errors were fixed | ||
id: react-if-fixed | ||
if: steps.commit-and-push.outcome == 'success' | ||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
reactions: hooray | ||
|
||
- name: react if linting errors were not fixed | ||
if: steps.commit-and-push.outcome == 'failure' | ||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
reactions: confused | ||
|
||
- name: react if linting errors were not fixed | ||
if: steps.commit-and-push.outcome == 'failure' | ||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 | ||
with: | ||
issue-number: ${{ github.event.issue.number }} | ||
body: | | ||
@${{ github.actor }} I tried to fix the linting errors, but it didn't work. Please fix them manually. | ||
See [CI log](https://github.com/nf-core/readsimulator/actions/runs/${{ github.run_id }}) for more details. |
Oops, something went wrong.