-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.37 KB
/
run_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# A reusable workflow to build and run the unit test suite
#
# This workflow will install Python dependencies, run tests,
# and report test results and code coverage as artifacts. It will
# be called by the workflow that run tests against new PRs and as
# a first step in the workflow that publishes new Docker images.
name: Unit Tests
on:
workflow_call:
secrets:
codecov_token:
required: true
workflow_dispatch:
env:
POETRY_VERSION: "1.3.2"
PYTHON_VERSION: "3.10"
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Retrieve repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install package
run: poetry install --with=harmony --without integration
- name: Run linting
run: |
poetry run ruff check concatenator
- name: Run tests and collect coverage
run: poetry run pytest --cov=concatenator --cov-report=xml tests/unit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
flags: unittests