Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Pipeline to Repo #35

Merged
merged 14 commits into from
Oct 21, 2024
79 changes: 79 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Step-time Biofeedback Project

on:
push:
branches:
- feature/*
pull_request:
branches:
- feature/*
workflow_dispatch:

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Download and cache virtual environment
run: |
pip install virtualenv
virtualenv env
source env/bin/activate
pip install -r requirements.txt

- name: Install frontend dependencies
run: |
cd ${{github.workspace}}/frontend
npm install
npm test

- name: Run backend tests
run: |
source env/bin/activate
cd ${{github.workspace}}/backend
pytest -s websocketUnitTest.py

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great test for WebSocket! Check edge cases too


lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Download and cache virtual environment
run: |
pip install virtualenv
virtualenv env
source env/bin/activate
pip install -r requirements.txt

- name: Lint Python Files
run: |
cd ${{github.workspace}}/backend
pylint *.py || true

- name: Lint JavaScript files
run: |
cd ${{github.workspace}}/frontend
npm install
npm run lint
4 changes: 2 additions & 2 deletions backend/connect_to_qtm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def stream_data (stream_type= 'Force', sleep_time= 0.1):
return

# create an inlet to read from the stream
inlet= StreamInlet(stream[0])
inlet= StreamInlet(streams[0])

# pull and log samples
try:
Expand All @@ -25,6 +25,6 @@ def stream_data (stream_type= 'Force', sleep_time= 0.1):
except KeyboardInterrupt:
print("Streaming stopped by user.")

if __name__ == "__main__":
if __name__ == "__main__":
stream_data()

Loading
Loading