Skip to content

Commit

Permalink
ci: exercise unit tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
joanise committed Nov 20, 2024
1 parent 3d4d5ca commit d947f86
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,31 @@ jobs:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: "pip"

- uses: FedericoCarboni/setup-ffmpeg@v2

- name: Install dependencies and package
run: pip install -e . mypy
- name: Minimal test, --help should work
run: ctc-segmenter --help
- name: Code quality test, mypy should pass
run: pip install -e . mypy coverage

- name: Minimal code quality test, mypy should pass
run: mypy aligner

- uses: actions/cache@v4
with:
path: /home/runner/.cache/torch
key: torch-cache

- name: Run unit tests
run: coverage run -m unittest discover aligner.tests -v

- run: coverage report

- name: Make sure the CLI stays fast
id: cli-load-time
run: |
Expand All @@ -44,6 +56,7 @@ jobs:
echo "Please run 'PYTHONPROFILEIMPORTTIME=1 ctc-segmenter -h 2> importtime.txt; tuna importtime.txt' and tuck away expensive imports so that the CLI doesn't load them until it uses them."; \
false; \
fi
- name: Report help speed in PR
if: github.event_name == 'pull_request'
uses: mshick/add-pr-comment@v2
Expand Down

0 comments on commit d947f86

Please sign in to comment.