Skip to content

Commit

Permalink
Merge pull request #2 from jennyfothergill/update/github
Browse files Browse the repository at this point in the history
Update/GitHub
  • Loading branch information
jennyfothergill authored Apr 5, 2021
2 parents c830508 + 4c2e9a9 commit 6455c75
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 22 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build

on:
push:
branches: [ master ]
# Run when container or environment is changed
paths:
- 'containers/dockerfile'
- 'environment.yml'
# Allows workflow to be manually triggered
workflow_dispatch:

jobs:
build_cpu:
runs-on: ubuntu-latest

steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./containers/dockerfile
push: true
tags: cmelab/cmeutils:latest
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
29 changes: 29 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: pytest

on:
push:
branches: [ master ]
paths:
- 'cmeutils/*'
pull_request:
branches: [ master ]
paths:
- 'cmeutils/*'

jobs:
pytest:
runs-on: ubuntu-latest
container:
image: cmelab/cmeutils:latest

steps:
- uses: actions/checkout@v2

- name: Run pytest with coverage report
run: python -m pytest --cov=./ --cov-report=xml -v

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
11 changes: 0 additions & 11 deletions .gitlab-ci.yml

This file was deleted.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# CME Lab Utilies

Helpful functions used by the [CME Lab](https://www.boisestate.edu/coen-cmsl).
Helpful functions used by the [CME Lab](https://www.boisestate.edu/coen-cmelab/).

### Installation
Installation of CME Lab Utilities requires the conda package manager. We recommend [Miniconda](https://docs.conda.io/en/latest/miniconda.html).
1. Clone this repository:
```
git clone git@gitlab.com:bsu/cme-lab/cme_lab_utils.git
cd cme_lab_utils
git git@github.com:cmelab/cmeutils.git
cd cmeutils
```
2. Set up and activate environment:
```
conda env create -f environment.yml
conda activate cmeutils
```
3. Install this package with pip:
```
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions cmeutils/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.0"
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions containers/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM continuumio/miniconda3:4.9.2

WORKDIR /opt/app

# Make RUN commands use `bash --login`: -- fixes conda init
# https://pythonspeed.com/articles/activate-conda-dockerfile/
SHELL ["/bin/bash", "--login", "-c"]

# Create the environment
COPY environment.yml ./

# Install in base environment
RUN conda env update -n base -f environment.yml && \
conda clean --all --yes -f

# Install curl for Codecov
RUN apt-get update && apt-get upgrade -y && apt-get install -y curl

# Prevent python from loading packages from outside the container
# default empty pythonpath
ENV PYTHONPATH /ignore/pythonpath
8 changes: 5 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: cmelab
name: cmeutils
channels:
- conda-forge
dependencies:
- python=3.7
- pip
- numpy
- pip
- python=3.7
- pytest
- pytest-cov
18 changes: 13 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import os
from setuptools import setup

setup(name='cme_lab_utils',
version='0.0',
description='Helpful functions used in the CME lab'
url='https://gitlab.com/bsu/cme-lab/cme_lab_utils',

NAME = "cmeutils"
here = os.path.abspath(os.path.dirname(__file__))
about = {}
with open(os.path.join(here, NAME, "__version__.py")) as f:
exec(f.read(), about)

setup(name=NAME,
version=about["__version__"],
description='Helpful functions used in the CME lab',
url='https://github.com/cmelab/cmeutils',
author='CME Lab',
author_email='ericjankowski@boisestate.edu',
license='GPLv3',
packages=['cme_lab_utils'],
packages=['cmeutils'],
zip_safe=False,
)

0 comments on commit 6455c75

Please sign in to comment.