-
Notifications
You must be signed in to change notification settings - Fork 430
133 lines (127 loc) · 4.84 KB
/
cloudtest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: nf-core cloud full size tests
# This workflow is triggered on PRs opened against the master branch.
# It can be additionally triggered manually with GitHub actions workflow dispatch button.
# It runs the -profile 'test_full' on cloud
on:
release:
types: [created]
pull_request_review:
types: [submitted]
workflow_dispatch:
inputs:
test:
description: "-profile test (smaller)"
type: boolean
default: true
somatic:
description: "Somatic full test"
type: boolean
default: false
germline:
description: "Germline full test"
type: boolean
default: false
germline_ncbench_agilent:
description: "Germline Agilent NCBench test"
type: boolean
default: false
aws:
description: "AWS Batch"
type: boolean
default: true
azure:
description: "Azure Batch"
type: boolean
default: true
jobs:
run-platform:
strategy:
fail-fast: false
matrix:
include:
- profile: test_aws
test: test
cloud: aws
compute_env: TOWER_COMPUTE_ENV
workdir: TOWER_BUCKET_AWS
- profile: test_azure
test: test
cloud: azure
compute_env: TOWER_CE_AZURE_CPU
workdir: TOWER_BUCKET_AZURE
- profile: test_full_aws
test: somatic
cloud: aws
compute_env: TOWER_COMPUTE_ENV
workdir: TOWER_BUCKET_AWS
- profile: test_full_azure
test: somatic
cloud: azure
compute_env: TOWER_CE_AZURE_CPU
workdir: TOWER_BUCKET_AZURE
- profile: test_full_germline_aws
test: germline
cloud: aws
compute_env: TOWER_COMPUTE_ENV
workdir: TOWER_BUCKET_AWS
- profile: test_full_germline_azure
test: germline
cloud: azure
compute_env: TOWER_CE_AZURE_CPU
workdir: TOWER_BUCKET_AZURE
- profile: test_full_germline_ncbench_agilent
test: germline_ncbench_agilent
cloud: aws
compute_env: TOWER_COMPUTE_ENV
workdir: TOWER_BUCKET_AWS
name: Run AWS full tests
# run only if the PR is approved by at least 2 reviewers and against the master branch or manually triggered
if: github.repository == 'nf-core/sarek' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Get PR reviews
uses: octokit/request-action@v2.x
if: github.event_name != 'workflow_dispatch'
id: check_approvals
continue-on-error: true
with:
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews?per_page=100
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check for approvals
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
run: |
echo "No review approvals found. At least 2 approvals are required to run this action automatically."
exit 1
- name: Check for enough approvals (>=2)
id: test_variables
if: github.event_name != 'workflow_dispatch'
run: |
JSON_RESPONSE='${{ steps.check_approvals.outputs.data }}'
CURRENT_APPROVALS_COUNT=$(echo $JSON_RESPONSE | jq -c '[.[] | select(.state | contains("APPROVED")) ] | length')
test $CURRENT_APPROVALS_COUNT -ge 2 || exit 1 # At least 2 approvals are required
# Launch workflow on AWS Batch
- name: Launch workflow via Seqera Platform
uses: seqeralabs/action-tower-launch@v2
# If inputs item exists (i.e. workflow_dispatch), then we find matrix.test and check it is false
# If is false, we negate and run the job
if: ( !contains(inputs[matrix.test], 'false') && !contains(inputs[matrix.cloud], 'false') )
with:
run_name: sarek_${{ matrix.profile }}
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}
compute_env: ${{ secrets[matrix.compute_env] }}
revision: ${{ github.sha }}
workdir: ${{ secrets[matrix.workdir] }}/work/sarek/work-${{ github.sha }}/${{ matrix.profile }}
parameters: |
{
"hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}",
"outdir": "${{ secrets[matrix.workdir] }}/sarek/results-${{ github.sha }}/${{ matrix.profile }}/"
}
profiles: ${{ matrix.profile }}
- uses: actions/upload-artifact@v4
with:
name: Seqera Platform debug log file
path: |
seqera_platform_action_*.log
seqera_platform_action_*.json