Skip to content

Commit

Permalink
Merge pull request #295 from simonsobs/develop
Browse files Browse the repository at this point in the history
Release v0.3.1
  • Loading branch information
BrianJKoopman authored May 10, 2022
2 parents 6f184ac + 299f3dd commit d0c763c
Show file tree
Hide file tree
Showing 98 changed files with 7,249 additions and 2,762 deletions.
10 changes: 10 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
max_line_length = 80
ignore = E501
in-place = true
recursive = true
aggressive = 2
exclude =
agents/meinberg_m1000/mibs/MBG-SNMP-LTNG-MIB.py
agents/meinberg_m1000/mibs/SNMPv2-MIB.py
agents/meinberg_m1000/mibs/MBG-SNMP-ROOT-MIB.py
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
77 changes: 10 additions & 67 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,7 @@ on:

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)
uses: ./.github/workflows/pytest.yml

docker:
name: build and deploy docker images
Expand All @@ -76,7 +16,7 @@ jobs:
steps:
# Fetch all history for all tags and branches
- name: clone socs
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -85,14 +25,17 @@ jobs:
run: |
docker-compose build
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- 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
Expand All @@ -113,12 +56,12 @@ jobs:

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

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

- name: install build dependencies
run: |
Expand Down
121 changes: 51 additions & 70 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,75 +3,16 @@ name: Build Develop Images
on:
push:
branches: [ develop ]
paths-ignore:
- 'docs/**'
- '*.rst'
- '*.md'
- '.flake8'
- '.pre-commit-config.yaml'

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

steps:
- 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

# (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)
uses: ./.github/workflows/pytest.yml

build:
name: build and deploy dev images
Expand All @@ -81,7 +22,7 @@ jobs:
steps:
# Fetch all history for all tags and branches
- name: clone socs
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -90,19 +31,59 @@ jobs:
run: |
docker-compose build
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build and push development docker image
env:
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
DOCKERHUB_ORG: "simonsobs"
run: |
export DOCKER_TAG=`git describe --tags --always`-dev
echo "${DOCKER_TAG}"
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}/{}:${DOCKER_TAG}
# Upload to docker registry
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
# testing so we can catch any issues before release
# if issues are found, test locally, or copy to pytest.yml for test on push
wheel:
name: build and test wheel
needs: test
runs-on: ubuntu-latest

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

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

- 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'
16 changes: 9 additions & 7 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ name: Run Tests
on:
push:
branches-ignore: [ develop ]
pull_request:
paths-ignore:
- 'docs/**'
- '*.rst'
- '*.md'
- '.flake8'
- '.pre-commit-config.yaml'
workflow_call:

jobs:
test:
Expand All @@ -21,7 +27,7 @@ jobs:
sudo apt-get install -y socat
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.8

Expand All @@ -31,7 +37,7 @@ jobs:
pip3 install so3g
- name: clone socs
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install socs
run: |
Expand All @@ -49,10 +55,6 @@ jobs:
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: |
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/skipped-pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Run Tests

on:
pull_request:
paths:
- 'docs/**'
- '*.rst'
- '*.md'
- '.flake8'
- '.pre-commit-config.yaml'

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

steps:
- run: 'echo "No build required" '
18 changes: 18 additions & 0 deletions .github/workflows/skipped-test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test Docker Build

on:
pull_request:
paths:
- 'docs/**'
- '*.rst'
- '*.md'
- '.flake8'
- '.pre-commit-config.yaml'

jobs:
build:
name: test image build
runs-on: ubuntu-latest

steps:
- run: 'echo "No build required" '
27 changes: 27 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test Docker Build

on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.rst'
- '*.md'
- '.flake8'
- '.pre-commit-config.yaml'

jobs:
build:
name: test image build
runs-on: ubuntu-latest

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

# Dockerize
- name: Build docker images
run: |
docker-compose build
Loading

0 comments on commit d0c763c

Please sign in to comment.