-
Notifications
You must be signed in to change notification settings - Fork 259
64 lines (59 loc) · 1.71 KB
/
ci.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
54
55
56
57
58
59
60
61
62
63
64
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
- ci-*
env:
HF_ALLOW_CODE_EVAL: 1
jobs:
check_code_quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[quality]
- name: Check quality
run: |
black --check --line-length 119 --target-version py36 tests src metrics comparisons measurements
isort --check-only tests src metrics comparisons measurements
flake8 tests src metrics
test:
needs: check_code_quality
strategy:
fail-fast: false
matrix:
test: ['unit', 'parity']
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: |
pip install .[tests]
pip install -r additional-tests-requirements.txt --no-deps
- name: Test with pytest
if: ${{ matrix.test == 'unit' }}
run: |
python -m pytest -n 2 --dist loadfile -sv ./tests/ --ignore=./tests/test_trainer_evaluator_parity.py
- name: Integration test with transformers
if: ${{ matrix.test == 'parity' }}
run: |
python -m pytest -n 2 --dist loadfile -sv ./tests/test_trainer_evaluator_parity.py