Skip to content

update gpu snapshot (automated) #8

update gpu snapshot (automated)

update gpu snapshot (automated) #8

name: update-gpu-snapshot
run-name: update gpu snapshot (automated)
on:
issue_comment:
types: [created]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# renovate: datasource=github-releases depName=askimed/nf-test versioning=semver
NFT_VER: "0.9.2"
NXF_ANSI_LOG: false
# renovate: datasource=github-releases depName=nextflow-io/nextflow versioning=semver
NXF_VER: "24.10.5"
jobs:
update-gpu-snapshot:
# 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/') &&
contains(github.event.comment.body, '@nf-core-bot update gpu snapshot') &&
github.repository == 'nf-core/methylseq'
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.xlarge/image=ubuntu24-gpu-x64"
steps:
# indication that the snapshot is being updated
- name: React on comment
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4
with:
comment-id: ${{ github.event.comment.id }}
reactions: eyes
# Use the @nf-core-bot token to check out so we can push later
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
token: ${{ secrets.nf_core_bot_auth_token }}
- name: Get the test path from the comment (after "@nf-core-bot update gpu snapshot path:")
id: get-test-path
run: |
echo "test_path=$(echo ${{ github.event.comment.body }} | grep -oP 'path:\s*\K[^ ]+')" >> $GITHUB_OUTPUT
- name: if test path is empty, exit
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4
if: steps.get-test-path.outputs.test_path == ''
with:
comment-id: ${{ github.event.comment.id }}
reactions: "-1"
- name: if test path is empty, exit
if: steps.get-test-path.outputs.test_path == ''
run: exit 0
# 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-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4
with:
distribution: "temurin"
java-version: "17"
- name: Set up Nextflow
uses: nf-core/setup-nextflow@v2
with:
version: "${{ env.NXF_VER }}"
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.13"
- name: Set up nf-test
uses: nf-core/setup-nf-test@v1
with:
version: "${{ env.NFT_VER }}"
install-pdiff: true
- name: Test CUDA
run: |
nvidia-smi -L
- name: Update gpu snapshot
id: update-gpu-snapshot
run: |
nf-test test \
--profile=docker,gpu \
--verbose \
--ci \
--update-snapshot \
--filter pipeline,workflow \
--tag gpu \
${{ steps.get-test-path.outputs.test_path }}
- name: Commit & push changes
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] Update GPU snapshot for ${{ steps.get-test-path.outputs.test_path }}"
git push
- name: React on comment (success)
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4
if: success()
with:
comment-id: ${{ github.event.comment.id }}
reactions: hooray
- name: React on comment (failure)
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4
if: failure()
with:
comment-id: ${{ github.event.comment.id }}
reactions: confused