Skip to content

Commit

Permalink
add test workflows and applied change to olaf_setup call
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpdx committed Nov 5, 2023
1 parent 849cf6a commit 51a51f0
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

63 changes: 63 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
tests:

runs-on: ubuntu-latest

steps:
- name: Clone oresat-cfc repository
uses: actions/checkout@v2

- name: Clone oresat-configs repository
uses: actions/checkout@v2
with:
repository: oresat/oresat-configs
path: resources/oresat-configs

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Build and install oresat-configs
working-directory: resources/oresat-configs
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m build
pip install dist/*.whl
- name: Clean up oresat-configs
run: rm -rf resources/oresat-configs

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with Pylama
run: pylama

- name: Check format with Black
run: black --check --diff .

- name: Check format with isort
run: isort --check --diff .

- name: Test with Python's unittest
run: python -m unittest

- name: Test building pypi package
run: python -m build

- name: Test building sphinx docs
run: make -C docs html
4 changes: 2 additions & 2 deletions oresat_cfc/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os

from olaf import app, olaf_run, olaf_setup, render_olaf_template, rest_api
from oresat_configs import OD_DB, NodeId
from oresat_configs import NodeId

from . import __version__
from .drivers.pirt1280 import Pirt1280
Expand All @@ -29,7 +29,7 @@ def main():

path = os.path.dirname(os.path.abspath(__file__))

args = olaf_setup(OD_DB, NodeId.CFC)
args, _ = olaf_setup(NodeId.CFC)
mock_args = [i.lower() for i in args.mock_hw]
mock_camera = "camera" in mock_args or "all" in mock_args
mock_tec = "tec" in mock_args or "all" in mock_args
Expand Down

0 comments on commit 51a51f0

Please sign in to comment.