2024-01-22 23:13:04 +08:00
|
|
|
name: tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-06-08 01:48:30 +08:00
|
|
|
branches:
|
2024-06-08 21:15:36 +08:00
|
|
|
- main
|
2024-06-08 01:48:30 +08:00
|
|
|
paths:
|
|
|
|
- "**.py"
|
|
|
|
- "requirements.txt"
|
|
|
|
- ".github/workflows/*.yml"
|
2024-06-08 21:25:35 +08:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- "**.py"
|
|
|
|
- "requirements.txt"
|
|
|
|
- ".github/workflows/*.yml"
|
2024-01-22 23:13:04 +08:00
|
|
|
|
|
|
|
jobs:
|
2024-06-08 02:42:34 +08:00
|
|
|
tests:
|
2024-01-22 23:13:04 +08:00
|
|
|
runs-on: ubuntu-latest
|
2024-06-08 21:11:32 +08:00
|
|
|
|
2024-07-14 15:44:30 +08:00
|
|
|
environment:
|
|
|
|
name: tests
|
|
|
|
|
|
|
|
env:
|
|
|
|
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
|
|
|
|
2024-01-22 23:13:04 +08:00
|
|
|
steps:
|
2024-06-08 21:11:32 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-01-22 23:22:15 +08:00
|
|
|
- name: Set up Python
|
2024-02-07 01:18:22 +08:00
|
|
|
uses: actions/setup-python@v5
|
2024-01-22 23:22:15 +08:00
|
|
|
with:
|
|
|
|
python-version: "3.8"
|
2024-06-08 01:48:30 +08:00
|
|
|
cache: "pip"
|
|
|
|
cache-dependency-path: "setup.py"
|
2024-06-08 21:11:32 +08:00
|
|
|
|
2024-01-22 23:22:15 +08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
2024-06-25 01:54:53 +08:00
|
|
|
python -m pip install ".[torch,dev]"
|
2024-06-08 21:11:32 +08:00
|
|
|
|
2024-01-22 23:22:15 +08:00
|
|
|
- name: Check quality
|
|
|
|
run: |
|
2024-06-08 01:57:36 +08:00
|
|
|
make style && make quality
|
2024-06-08 21:11:32 +08:00
|
|
|
|
2024-06-08 01:48:30 +08:00
|
|
|
- name: Test with pytest
|
|
|
|
run: |
|
|
|
|
make test
|