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

Init first unittest for add_workflows_from_workflowhub #223

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/workflows/lint.yaml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/lint_and_unittest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Code best practice and unittesting

on:
pull_request:
branches:
- main
paths:
- 'bin/**' # This will trigger the workflow only if files in the 'bin' folder are modified.

concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install tox
run: python -m pip install 'tox>=1.8.0'
- name: Lint
run: tox -e lint

unittest:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.11']
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Run unittests
run: |
PYTHONPATH=bin python -m unittest discover -s bin/tests
7 changes: 7 additions & 0 deletions sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ When the tests succeed a maintainer will merge the dev branch into main. Feel fr

The reason we are not running the tests directly on the pull request branch is, that this does not allow to access the GitHub secrets, that are required to run the tests.

# Run the unit tests locally

```
cd codex/sources
PYTHONPATH=bin python -m unittest discover -s bin/tests
```

### Tools

To make a test run of the tool to check its functionalities follow [Usage](#Usage) to set-up the environnement and the API key, then run
Expand Down
Loading