Skip to content

Commit

Permalink
Merge pull request #247 from simonsobs/develop
Browse files Browse the repository at this point in the history
Release v0.3.0
  • Loading branch information
BrianJKoopman authored Feb 15, 2022
2 parents 006ac72 + e0140e7 commit 6f184ac
Show file tree
Hide file tree
Showing 131 changed files with 10,882 additions and 1,320 deletions.
11 changes: 2 additions & 9 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
[run]
source = socs

omit =
# omit versioneer
*/_version.py

[paths]
source =
socs/
/app/socs/socs/
./
/app/socs/
146 changes: 146 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Deploy Builds

on:
release:
types: [ released ]

jobs:
test:
name: pytest with coverage
runs-on: ubuntu-latest

steps:
- name: Install system packages
run: |
sudo apt-get install -y socat
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

# (start steps from pytest workflow)
# Install
- name: Install so3g
run: |
pip3 install so3g
# Fetch all history for all tags and branches
- name: clone socs
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install socs
run: |
pip3 install -r requirements.txt
pip3 install -e .
# Unit Tests
- name: Run unit tests
working-directory: ./tests
run: |
COVERAGE_FILE=.coverage.unit python3 -m pytest --cov -m 'not integtest'
- name: Build docker test images
run: |
docker-compose build socs
# Integration Tests
- name: Build images for integration tests
run: |
docker-compose build ocs-lakeshore372-simulator
- name: Run integration tests
working-directory: ./tests
run: |
COVERAGE_FILE=.coverage.int python3 -m pytest --cov -m 'integtest'
# Coverage
- name: Report test coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv ./tests/.coverage.* ./
pip install coveralls
coverage combine
coverage report
coveralls --service=github
# (end steps from pytest workflow)

docker:
name: build and deploy docker images
needs: test
runs-on: ubuntu-latest

steps:
# Fetch all history for all tags and branches
- name: clone socs
uses: actions/checkout@v2
with:
fetch-depth: 0

# Dockerize
- name: Build docker images
run: |
docker-compose build
- name: Build and push official docker image
env:
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
DOCKERHUB_ORG: "simonsobs"
run: |
export DOCKER_TAG=`git describe --tags --always`
echo "${REGISTRY_PASSWORD}" | docker login -u "${REGISTRY_USER}" --password-stdin;
# Tag all images for upload to the registry
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker tag {}:latest ${DOCKERHUB_ORG}/{}:latest
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker tag {}:latest ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
# Upload to docker registry
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker push ${DOCKERHUB_ORG}/{}:latest
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker push ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} echo ${DOCKERHUB_ORG}/{}:${DOCKER_TAG} pushed
wheel:
name: build and deploy to PyPI
needs: test
runs-on: ubuntu-latest
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}

steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: clone socs
uses: actions/checkout@v2

- name: install build dependencies
run: |
python3 -m pip install --upgrade build twine
- name: build wheel
run: |
python3 -m build
- name: install wheel
run: |
python3 -m pip install dist/socs*.whl
- name: install testing requirements
run: |
pip3 install -r requirements/testing.txt
- name: Run unit tests
working-directory: ./tests
run: |
python3 -m pytest -m 'not (integtest or spt3g)'
- name: upload to PyPI
run: |
python3 -m twine upload dist/*
75 changes: 62 additions & 13 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,91 @@ on:
branches: [ develop ]

jobs:
build:
runs-on: ubuntu-18.04
test:
name: pytest with coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
# Fetch all history for all tags and branches
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
fetch-depth: 0
access_token: ${{ github.token }}

- name: Install system packages
run: |
sudo apt-get install -y socat
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

# Test (steps from pytest workflow)
- name: Build docker images
# (start steps from pytest workflow)
# Install
- name: Install so3g
run: |
docker-compose build
pip3 install so3g
# Fetch all history for all tags and branches
- name: clone socs
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install socs
run: |
pip3 install -r requirements.txt
pip3 install -e .
# Unit Tests
- name: Run unit tests
working-directory: ./tests
run: |
COVERAGE_FILE=.coverage.unit python3 -m pytest --cov -m 'not integtest'
- name: Test with pytest within a docker container
- name: Build docker test images
run: |
docker run -v $PWD:/coverage --rm socs sh -c "COVERAGE_FILE=/coverage/.coverage.docker python3 -m pytest -p no:wampy --cov /app/socs/socs/ ./tests/"
docker-compose build socs
# Integration Tests
- name: Build images for integration tests
run: |
docker-compose build ocs-lakeshore372-simulator
- name: Run integration tests
working-directory: ./tests
run: |
COVERAGE_FILE=.coverage.int python3 -m pytest --cov -m 'integtest'
# Coverage
- name: Report test coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv ./tests/.coverage.* ./
pip install coveralls
coverage combine
coverage report
coveralls --service=github
# (end steps from pytest workflow)

- name: Test documentation build
run: |
docker run --rm -e READTHEDOCS=True socs sh -c "make -C docs/ html"
build:
name: build and deploy dev images
needs: test
runs-on: ubuntu-latest

steps:
# Fetch all history for all tags and branches
- name: clone socs
uses: actions/checkout@v2
with:
fetch-depth: 0

# Dockerize
- name: Build docker images
run: |
docker-compose build
- name: Build and push development docker image
env:
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/official-docker-images.yml

This file was deleted.

54 changes: 43 additions & 11 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,65 @@ on:
pull_request:

jobs:
build:
runs-on: ubuntu-18.04
test:
name: pytest with coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Install system packages
run: |
sudo apt-get install -y socat
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Build docker images
# Install
- name: Install so3g
run: |
docker-compose build
pip3 install so3g
- name: Test with pytest wtihin a docker container
- name: clone socs
uses: actions/checkout@v2

- name: Install socs
run: |
pip3 install -r requirements.txt
pip3 install -e .
# Unit Tests
- name: Run unit tests
working-directory: ./tests
run: |
docker run -v $PWD:/coverage --rm socs sh -c "COVERAGE_FILE=/coverage/.coverage.docker python3 -m pytest -p no:wampy --cov /app/socs/socs/ ./tests/"
COVERAGE_FILE=.coverage.unit python3 -m pytest --cov -m 'not integtest'
- name: Build docker test images
run: |
docker-compose build socs
# Integration Tests
- name: Build images for integration tests
run: |
docker-compose build ocs-lakeshore372-simulator
- name: Run integration tests
working-directory: ./tests
run: |
COVERAGE_FILE=.coverage.int python3 -m pytest --cov -m 'integtest'
# Coverage
- name: Report test coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv ./tests/.coverage.* ./
pip install coveralls
coverage combine
coverage report
coveralls --service=github
- name: Test documentation build
run: |
docker run --rm -e READTHEDOCS=True socs sh -c "make -C docs/ html"
Loading

0 comments on commit 6f184ac

Please sign in to comment.