name: nf-core AWS test
# This workflow can be triggered manually with the GitHub actions workflow dispatch button.
# It runs the -profile 'test' on AWS batch

on:
  workflow_dispatch:
jobs:
  run-tower:
    name: Run AWS tests
    if: github.repository == 'nf-core/scrnaseq'
    runs-on: ubuntu-latest
    strategy:
      matrix:
        aligner: ["alevin", "kallisto", "star", "cellranger", "universc"]
    steps:
      # Launch workflow using Tower CLI tool action
      - name: Launch workflow via tower
        uses: seqeralabs/action-tower-launch@v2
        with:
          workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
          access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}
          compute_env: ${{ secrets.TOWER_COMPUTE_ENV }}
          revision: ${{ github.sha }}
          workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/scrnaseq/work-${{ github.sha }}
          parameters: |
            {
              "outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/scrnaseq/results-test-${{ github.sha }}/aligner_${{ matrix.aligner }}",
              "aligner": "${{ matrix.aligner }}"
            }
          profiles: test
      - uses: actions/upload-artifact@v3
        with:
          name: Tower debug log file
          path: |
            tower_action_*.log
            tower_action_*.json
