Skip to content

Commit

Permalink
Merge pull request #245 from simonsobs/develop
Browse files Browse the repository at this point in the history
Release v0.9.0
  • Loading branch information
BrianJKoopman authored Nov 29, 2021
2 parents e1a813e + 1be6e11 commit 15e2c3a
Show file tree
Hide file tree
Showing 84 changed files with 4,385 additions and 1,158 deletions.
11 changes: 2 additions & 9 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
[run]
source = ocs

omit =
# omit versioneer
*/_version.py

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

on:
release:
types: [ released ]

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

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

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

- name: Install ocs
run: |
pip3 install -r requirements.txt
pip3 install -e .
# Test (already been run by pytest workflow, but they don't take long...)
# Unit Tests
- name: Run unit tests
working-directory: ./tests
run: |
COVERAGE_FILE=.coverage.unit python3 -m pytest --cov -m 'not (integtest or spt3g)'
- name: Build docker image for containerized tests
run: |
docker-compose build ocs
- name: Test with pytest within a docker container
run: |
docker run -v $PWD:/coverage --rm -w="/app/ocs/tests/" ocs sh -c "COVERAGE_FILE=/coverage/.coverage.docker python3 -m pytest --cov -m 'spt3g'"
# Integration Tests
- name: Build images for integration tests
run: |
docker-compose build ocs-fake-data-agent ocs-aggregator-agent ocs-crossbar
- name: Run integration tests
working-directory: ./tests
run: |
mkdir log
COVERAGE_FILE=.coverage.int python3 -m pytest --cov -m 'integtest'
ls -la ./log/
# 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
docker:
name: build and deploy docker images
needs: test
runs-on: ubuntu-latest

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

# Dockerize
- name: Build all 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 ocs
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/ocs*.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 test PyPI
run: |
python3 -m twine upload --repository testpypi dist/*
64 changes: 52 additions & 12 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,82 @@ 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
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

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

- name: Install ocs
run: |
pip3 install -r requirements.txt
pip3 install -e .
# Test (steps from pytest workflow)
- name: Build docker images
# Unit Tests
- name: Run unit tests
working-directory: ./tests
run: |
docker-compose build
COVERAGE_FILE=.coverage.unit python3 -m pytest --cov -m 'not (integtest or spt3g)'
- name: Build docker image for containerized tests
run: |
docker-compose build ocs
- name: Test with pytest within a docker container
run: |
docker run -v $PWD:/coverage --rm ocs sh -c "COVERAGE_FILE=/coverage/.coverage.docker python3 -m pytest -m 'not integtest' --cov /app/ocs/ocs/ ./tests/"
docker run -v $PWD:/coverage --rm -w="/app/ocs/tests/" ocs sh -c "COVERAGE_FILE=/coverage/.coverage.docker python3 -m pytest --cov -m 'spt3g'"
# Integration Tests
- name: Build images for integration tests
run: |
docker-compose build ocs-fake-data-agent ocs-aggregator-agent ocs-crossbar
- name: Run integration tests
working-directory: ./tests
run: |
mkdir log
COVERAGE_FILE=.coverage.int python3 -m pytest --cov -m 'integtest'
ls -la ./log/
# 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 ocs sh -c "make -C docs/ html"
build:
name: build and deploy dev images
needs: test
runs-on: ubuntu-latest

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

# Dockerize
- name: Build all 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.

48 changes: 36 additions & 12 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@ 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: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Build docker images
run: |
docker-compose build
- name: clone ocs
uses: actions/checkout@v2

# I like this idea, but let's hold off for now.
#- name: Lint with flake8
Expand All @@ -31,19 +30,44 @@ jobs:
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest wtihin a docker container
- name: Install ocs
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 or spt3g)'
- name: Build docker image for containerized tests
run: |
docker-compose build ocs
- name: Test with pytest within a docker container
run: |
docker run -v $PWD:/coverage --rm ocs sh -c "COVERAGE_FILE=/coverage/.coverage.docker python3 -m pytest -m 'not integtest' --cov /app/ocs/ocs/ ./tests/"
docker run -v $PWD:/coverage --rm -w="/app/ocs/tests/" ocs sh -c "COVERAGE_FILE=/coverage/.coverage.docker python3 -m pytest --cov -m 'spt3g'"
# Integration Tests
- name: Build images for integration tests
run: |
docker-compose build ocs-fake-data-agent ocs-aggregator-agent ocs-crossbar
- name: Run integration tests
working-directory: ./tests
run: |
mkdir log
COVERAGE_FILE=.coverage.int python3 -m pytest --cov -m 'integtest'
ls -la ./log/
# 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 ocs sh -c "make -C docs/ html"
10 changes: 10 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2

sphinx:
configuration: docs/conf.py

python:
version: 3.7
install:
- requirements: docs/requirements.txt
- requirements: requirements.txt
Loading

0 comments on commit 15e2c3a

Please sign in to comment.