-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from sunbeam-labs/12-containerize-and-version
12 containerize and version
- Loading branch information
Showing
14 changed files
with
258 additions
and
86 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Push to DockerHub | ||
|
||
on: | ||
workflow_call: | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-push-to-dockerhub: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: sunbeamlabs/sbx_template | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: envs/sbx_template_env.Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-tests: | ||
uses: ./.github/workflows/tests.yml | ||
secrets: inherit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
run-tests: | ||
uses: ./.github/workflows/tests.yml | ||
secrets: inherit | ||
|
||
check-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get sbx version | ||
shell: bash | ||
run: | | ||
SBX_VER=$(cat VERSION) | ||
echo "SBX_VER=$SBX_VER" >> $GITHUB_ENV | ||
- id: get_version | ||
uses: battila7/get-version-action@v2 | ||
|
||
- name: Check version | ||
shell: bash | ||
run: | | ||
RELEASE_VERSION=${{ steps.get_version.outputs.version-without-v }} | ||
echo "Release version: ${RELEASE_VERSION}" | ||
echo "Sbx version: ${{ env.SBX_VER }}" | ||
if [[ $RELEASE_VERSION == ${{ env.SBX_VER }} ]]; then | ||
echo "Versions match, continuing..." | ||
else | ||
echo "Versions don't match, exiting..." | ||
exit 1 | ||
fi | ||
push-to-dockerhub: | ||
uses: ./.github/workflows/docker.yml | ||
secrets: inherit | ||
needs: | ||
- run-tests | ||
- check-version | ||
|
||
test-apptainer: | ||
name: Apptainer Test | ||
runs-on: ubuntu-latest | ||
needs: push-to-dockerhub | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set test env | ||
run: echo "SUNBEAM_TEST_PROFILE=apptainer" >> $GITHUB_ENV | ||
|
||
- uses: eWaterCycle/setup-apptainer@v2 | ||
with: | ||
apptainer-version: 1.1.2 | ||
|
||
- name: Test with Sunbeam | ||
uses: sunbeam-labs/sbx_test_action@v1 | ||
with: | ||
test-directory: ".tests/e2e/" | ||
|
||
- name: Dump Logs | ||
shell: bash | ||
if: always() | ||
run: tail -n +1 logs/* | ||
|
||
- name: Dump Stats | ||
shell: bash | ||
if: always() | ||
run: cat stats/* |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.0.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sbx_template: | ||
example_rule_options: '' | ||
example_rule_options: 'DUMMY STRING' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM condaforge/mambaforge:latest | ||
|
||
# Setup | ||
WORKDIR /home/sbx_template_env | ||
|
||
COPY envs/sbx_template_env.yml ./ | ||
|
||
# Install environment | ||
RUN conda env create --file sbx_template_env.yml --name sbx_template | ||
|
||
ENV PATH="/opt/conda/envs/sbx_template/bin/:${PATH}" | ||
|
||
# "Activate" the environment | ||
SHELL ["conda", "run", "-n", "sbx_template", "/bin/bash", "-c"] | ||
|
||
# Run | ||
CMD "bash" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ name: sbx_template | |
channels: | ||
- conda-forge | ||
- bioconda | ||
dependencies: | ||
- samtools |
Oops, something went wrong.