Wave with Docker and Spack #73
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Wave | |
# When environment.yml is changed | |
on: | |
pull_request: | |
paths: | |
- "**/environment.yml" | |
- "**/Dockerfile" | |
- "**/spack.yml" | |
env: | |
WAVE_VER: "1.2.0" | |
jobs: | |
gen-matrix: | |
name: generate-matrix | |
runs-on: ubuntu-latest | |
outputs: | |
conda-matrix: ${{ steps.conda-diff.outputs.all_changed_files }} | |
docker-matrix: ${{ steps.docker-diff.outputs.all_changed_files }} | |
spack-matrix: ${{ steps.spack-diff.outputs.all_changed_files }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Find conda differences | |
id: conda-diff | |
uses: tj-actions/changed-files@v42 | |
with: | |
json: true | |
escape_json: false | |
files: | | |
modules/**/environment.yml | |
- name: Find Dockerfile differences | |
id: docker-diff | |
uses: tj-actions/changed-files@v42 | |
with: | |
json: true | |
escape_json: false | |
files: | | |
modules/**/Dockerfile | |
- name: Find Spack differences | |
id: spack-diff | |
uses: tj-actions/changed-files@v42 | |
with: | |
json: true | |
escape_json: false | |
files: | | |
modules/**/spack.yml | |
conda-build: | |
if: "${{ fromJson(needs.gen-matrix.outputs.conda-matrix) }}" | |
needs: gen-matrix | |
name: Conda | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
max-parallel: 4 | |
matrix: | |
files: "${{ fromJson(needs.gen-matrix.outputs.conda-matrix) }}" | |
steps: | |
# Use the @nf-core-bot token to check out so we can push later | |
- uses: actions/checkout@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@v7 | |
id: registry-name | |
with: | |
result-encoding: string | |
script: | | |
return '${{ matrix.files }}'.replace('modules/nf-core/', '').replace('/environment.yml', '').replace('/', '_'); | |
- name: Build container | |
run: | | |
wave --conda-file "${{ matrix.files }}" \ | |
--freeze \ | |
--await \ | |
--build-repo quay.io/nf-core/modules/${{steps.registry-name.outputs.result}} \ | |
--cache-repository quay.io/nf-core/wave-cache \ | |
--tower-token ${{ secrets.TOWER_ACCESS_TOKEN }} \ | |
--tower-workspace-id ${{ secrets.TOWER_WORKSPACE_ID }} | |
docker-build: | |
if: "${{ fromJson(needs.gen-matrix.outputs.docker-matrix) }}" | |
needs: gen-matrix | |
name: Docker | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
max-parallel: 4 | |
matrix: | |
files: "${{ fromJson(needs.gen-matrix.outputs.docker-matrix) }}" | |
steps: | |
# Use the @nf-core-bot token to check out so we can push later | |
- uses: actions/checkout@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@v7 | |
id: registry-name | |
with: | |
result-encoding: string | |
script: | | |
return '${{ matrix.files }}'.replace('modules/nf-core/', '').replace('/Dockerfile', '').replace('/', '_'); | |
- name: Build container | |
run: | | |
wave -f "${{ matrix.files }}" \ | |
--freeze \ | |
--await \ | |
--build-repo quay.io/nf-core/modules/${{steps.registry-name.outputs.result}} \ | |
--cache-repository quay.io/nf-core/wave-cache \ | |
--tower-token ${{ secrets.TOWER_ACCESS_TOKEN }} \ | |
--tower-workspace-id ${{ secrets.TOWER_WORKSPACE_ID }} | |
# FIXME https://github.com/seqeralabs/wave/issues/351 | |
# spack-build: | |
# if: "${{ fromJson(needs.gen-matrix.outputs.spack-matrix) }}" | |
# needs: gen-matrix | |
# name: Spack | |
# runs-on: ubuntu-latest | |
# timeout-minutes: 60 | |
# strategy: | |
# fail-fast: false | |
# max-parallel: 4 | |
# matrix: | |
# files: "${{ fromJson(needs.gen-matrix.outputs.spack-matrix) }}" | |
# steps: | |
# # Use the @nf-core-bot token to check out so we can push later | |
# - uses: actions/checkout@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@v7 | |
# id: registry-name | |
# with: | |
# result-encoding: string | |
# script: | | |
# return '${{ matrix.files }}'.replace('modules/nf-core/', '').replace('/spack.yml', '').replace('/', '_'); | |
# - name: Build container | |
# run: | | |
# wave --spack-file "${{ matrix.files }}" \ | |
# --freeze \ | |
# --await \ | |
# --build-repo quay.io/nf-core/modules/${{steps.registry-name.outputs.result}} \ | |
# --cache-repository quay.io/nf-core/wave-cache \ | |
# --tower-token ${{ secrets.TOWER_ACCESS_TOKEN }} \ | |
# --tower-workspace-id ${{ secrets.TOWER_WORKSPACE_ID }} |