-
Notifications
You must be signed in to change notification settings - Fork 734
141 lines (123 loc) · 4.54 KB
/
wave.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
134
135
136
137
138
139
140
141
name: Wave
# When environment.yml is changed
on:
pull_request:
paths:
- "**/environment.yml"
# TODO On complete call testing CI
# TODO Skip testing CI if any changes to environment.yml
env:
WAVE_VER: "1.5.0"
NFTEST_VER: "0.9.1"
jobs:
generate-matrix:
name: generate-matrix
runs-on: ubuntu-latest
if: github.repository == 'nf-core/modules'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Calculate file differences
id: diff
uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf # v45
with:
json: true
quotepath: false
# TODO Add Dockerfiles
files: |
modules/**/environment.yml
- name: Debug
run: echo ${{ steps.diff.outputs.all_changed_files }}
- id: set-matrix
run: echo "matrix={\"profile\":[\"docker\", \"singularity\"],\"files\":${{ steps.diff.outputs.all_changed_files }} }" >> "$GITHUB_OUTPUT"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
build:
# NOTE This should get skipped because generate-matrix won't run
# if: github.repository == 'nf-core/modules'
if: "${{ fromJson(needs.generate-matrix.outputs.matrix) }}"
needs: generate-matrix
name: build
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix: "${{ fromJson(needs.generate-matrix.outputs.matrix) }}"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Install wave-cli
run: |
wget -q https://github.com/seqeralabs/wave-cli/releases/download/v${WAVE_VER}/wave-${WAVE_VER}-linux-x86_64
sudo mv wave-${WAVE_VER}-linux-x86_64 /usr/local/bin/wave
chmod +x /usr/local/bin/wave
- name: Create a registry name
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
id: registry-name
with:
result-encoding: string
script: |
return '${{ matrix.files }}'.replace('modules/nf-core/', '').replace('/environment.yml', '').replace('/', '_');
- name: Build container
if: matrix.profile == 'docker'
run: |
wave --conda-file "${{ matrix.files }}" \
--freeze \
--await \
--tower-token ${{ secrets.TOWER_ACCESS_TOKEN }} \
--tower-workspace-id ${{ secrets.TOWER_WORKSPACE_ID }}
- name: Build Singularity
if: matrix.profile == 'singularity'
run: |
wave --conda-file "${{ matrix.files }}" \
--freeze \
--await \
--tower-token ${{ secrets.TOWER_ACCESS_TOKEN }} \
--tower-workspace-id ${{ secrets.TOWER_WORKSPACE_ID }} \
--singularity
# TODO Build from Dockerfiles
# bump-versions:
# needs: generate-matrix
# name: bump-versions
# runs-on: ubuntu-latest
# steps:
# - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
# with:
# distribution: "temurin"
# java-version: "17"
# - uses: nf-core/setup-nextflow@v2
# - uses: nf-core/setup-nf-test@v1
# with:
# version: ${{ env.NFTEST_VER }}
# - name: Bump Snapshot Versions
# env:
# # NFT_DIFF: "pdiff"
# # NFT_DIFF_ARGS: "--line-numbers --width 120 --expand-tabs=2"
# SENTIEON_LICSRVR_IP: ${{ secrets.SENTIEON_LICSRVR_IP }}
# SENTIEON_AUTH_MECH: "GitHub Actions - token"
# run: |
# # use "docker_self_hosted" if it runs on self-hosted runner and matrix.profile=docker
# if [ "${{ matrix.profile }}" == "docker" ]; then
# PROFILE="docker_self_hosted"
# else
# PROFILE=${{ matrix.profile }}
# fi
# NFT_WORKDIR=~ \
# nf-test test \
# --profile=${{ matrix.profile }} \
# --tap=test.tap \
# # --ci \
# --verbose \
# --only-changed \
# # --shard ${{ matrix.shard }}/${{ env.TOTAL_SHARDS }} \
# # --filter ${{ matrix.filter }} \
# --follow-dependencies \
# --tag version \
# --update-snapshot
# - name: Commit & push version bumps
# 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] Bump versions snapshot"
# git push