Skip to content

Commit

Permalink
add GitHub Action for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SimeonEhrig committed Jan 23, 2024
1 parent 3207d45 commit c49b357
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeCoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
with:
fetch-depth: 2
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.12
- name: Install bashi
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/testDeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: test-and-deploy
on: [push, pull_request]
jobs:
formatter:
name: runner black code formatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rickstaa/action-black@v1
with:
black_args: ". --check"

unit-tests:
runs-on: ubuntu-latest
needs: formatter
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
name: Run unit tests with Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install bashi
run: |
pip install .
- name: run unit tests
run: python -m unittest discover -s tests
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ It is strongly recommended to use a Python environment for developing the code,
2. Activate the environment: `source env/bin/activate`
3. Install the library: `pip install --editable .`
4. Test the installation with the example: `python3 example/example.py`
5. You can run the unit tests by going to the `test` directory and running `python -m unittest`
5. You can run the unit tests by going to the `test` directory and running `python -m unittest discover -s tests`

If the example works correctly, a `job.yml` will be created in the current directory. You can also run `python3 example/example.py --help` to see additional options.

Expand Down

0 comments on commit c49b357

Please sign in to comment.