forked from anthony-wang/CrabNet
-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (48 loc) · 1.57 KB
/
flit-install-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
name: Install with flit and test via Pytest
on:
push:
paths:
- '**.py' # only run workflow when source files changed
- '**.yml'
- 'requirements.txt'
- 'pyproject.toml'
branches:
- "**"
tags-ignore:
- "*.*.*"
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 9
fail-fast: true
matrix:
os: [ubuntu-latest] # much slower on Mac and Win, but can use [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Check Black code style
uses: psf/black@stable #https://black.readthedocs.io/en/stable/integrations/github_actions.html
- name: Upgrade pip, install dependencies
shell: bash {0}
run: |
pip install --upgrade pip
pip install flit torch
flit install
- name: Test with Pytest on MacOS or Ubuntu
shell: bash {0}
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
run: |
python -m pytest
- name: Test with Pytest on Windows
shell: bash {0}
if: startsWith(matrix.os, 'windows')
run: |
python -m pytest
# NOTES:
# needed to use python instead of python3 for Windows https://stackoverflow.com/questions/61558780/python-testing-with-github-actions-on-windows
# also needed to remove the -l from the shell so it didn't interfere with MacOS PATH calling Python 2.7