Skip to content

Commit

Permalink
GIT: README, workflow and badges
Browse files Browse the repository at this point in the history
  • Loading branch information
rpartzsch committed Jan 18, 2025
1 parent 8834757 commit 206b167
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/pre_commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
on:
pull_request:
push:
branches: [main, ui_tests]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
11 changes: 1 addition & 10 deletions .github/workflows/workflows.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
name: tests

on:
pull_request:
push:
branches: [main]
branches: [main, ui_tests]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]

pytest:
runs-on: ubuntu-latest
steps:
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Motor stage UI
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) ![Tests](https://github.com/SiLab-Bonn/motor_stage_ui/tree/ui_tests/.github/tests/badge.svg) ![pre-commit](https://github.com/SiLab-Bonn/motor_stage_ui/tree/ui_tests/.github/pre_commit/badge.svg)

Offers both a terminal and graphical user interface for the [C-863 Mercury controller](https://www.le.infn.it/~chiodini/allow_listing/pi/Manuals/C-863_UserManual_MS205E200.pdf) (Check also the [commands](https://twiki.cern.ch/twiki/bin/viewfile/ILCBDSColl/Phase2Preparations?rev=1;filename=MercuryNativeCommands_MS176E101.pdf)).
Motor stages can be arranged in daisy chains.
Expand Down Expand Up @@ -58,3 +58,21 @@ The step size of a specific stage is given in um for translation stages and deg
| `stop` | `Stop` | Immediately stops all movement of the stage | motor_name (str): name of the motorstage | - |
| `sethome` | `Set Zero` | Sets the current position of the stage as new origin | motor_name (str): name of the motorstage | - |
| `gohome` | `MV. Zero` | Goes to origin of the stage | motor_name (str): name of the motorstage | - |
| `status` | -` | Returns the status of the motor controller | motor_name (str): name of the motorstage | - |

## Tests

General UI tests, utilizing a motor controller mock, are performed when setting the environmental variable 'TEST' e.g.:

```bash
TEST=True motor init x_axis
```

```bash
TEST=True motorgui
```
Utilizing [pytest](https://docs.pytest.org/en/stable/) the mock tests the software.

```bash
pytest -sv
```

0 comments on commit 206b167

Please sign in to comment.