-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (63 loc) · 2.03 KB
/
test.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
65
66
# Source: https://github.com/stanford-crfm/helm/blob/main/.github/workflows/test.yml
name: Test
on:
push:
branches: [ main ]
paths-ignore:
- 'experimental/**'
pull_request:
paths-ignore:
- 'experimental/**'
jobs:
install:
name: Install dependencies and perform small run
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements.txt') }}-${{ matrix.python-version }}
restore-keys: |
pip-
- run: python3 -m pip install virtualenv && python3 -m virtualenv -p python3 venv
- run: source venv/bin/activate && sudo sh ./install-dev.sh
- run: source venv/bin/activate && ./pre-commit.sh
# TODO: Add a small run here
test:
name: Run all tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- name: Clear free space
run: |
sudo rm -rf /opt/ghc
df -h
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
pip-
# Installs dependencies and performs static code checks
- run: python3 -m pip install virtualenv && python3 -m virtualenv -p python3 venv
- run: source venv/bin/activate && sudo sh ./install-dev.sh
- run: source venv/bin/activate && ./pre-commit.sh
- name: Run tests
run: source venv/bin/activate && pytest --durations=20
env:
TEST: ${{ matrix.test }}
VERSION: ${{ github.head_ref || 'main' }}