Skip to content

Commit

Permalink
Add GitHub actions to test environments and Publish docker images (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche authored Jan 24, 2025
1 parent e82c5e8 commit c7bb78f
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 6 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/create-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Create Docker images

on:
push:
tags: "*"

jobs:
create_docker:
runs-on: ubuntu-latest
strategy:
matrix:
conda-config: [release]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v4
with:
name: ${{ github.repository }}/${{ matrix.conda-config }}:${{ github.ref_name }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
dockerfile: ${{ matrix.conda-config }}.dockerfile
registry: ghcr.io
snapshot: true
35 changes: 35 additions & 0 deletions .github/workflows/create-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Create the environment

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
conda-config: [release]

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v2
with:
environment-file: envs/${{ matrix.conda-config }}.yml
init-shell: >-
bash
cache-environment: true
cache-downloads: true
post-cleanup: "all"

- name: Test for import
run: python -c "import genomicranges"
shell: bash -el {0}

- name: Snapshot the package versions in the environment
run: pip list
shell: micromamba-shell {0}
2 changes: 1 addition & 1 deletion envs/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: biocpy_devel
name: biocpy_release
channels:
- conda-forge
dependencies:
Expand Down
10 changes: 5 additions & 5 deletions release.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM condaforge/miniforge3:latest
FROM mambaorg/micromamba:2.0.5

WORKDIR /biocenv
COPY . /biocenv
RUN mamba --version
COPY --chown=$MAMBA_USER:$MAMBA_USER envs/release.yml /tmp/env.yaml
RUN micromamba --version

RUN mamba env create -f env/release.yml
RUN micromamba install -y -n base -f /tmp/env.yaml && \
micromamba clean --all --yes

0 comments on commit c7bb78f

Please sign in to comment.