name: nf-core AWS full size tests germline
# This workflow is triggered on published releases.
# It can be additionally triggered manually with GitHub actions workflow dispatch button.
# It runs the -profile 'test_full' on AWS batch

on:
  release:
    types: [published]
  workflow_dispatch:
jobs:
  run-tower:
    name: Run AWS full tests
    if: github.repository == 'nf-core/sarek'
    runs-on: ubuntu-latest
    steps:
      # Launch workflow using Tower CLI tool action
      - name: Launch workflow via tower
        uses: seqeralabs/action-tower-launch@v1
        with:
          workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
          access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}
          compute_env: ${{ secrets.TOWER_COMPUTE_ENV }}
          workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/sarek/work-${{ github.sha }}/germline_test
          parameters: |
            {
              "hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}",
              "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/sarek/results-${{ github.sha }}/germline_test"
            }
          profiles: test_full_germline
      - uses: actions/upload-artifact@v3
        with:
          name: Tower debug log file
          path: tower_action_*.log
