forked from anthony-wang/CrabNet
-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (41 loc) · 1.32 KB
/
os-matrix.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
on:
push:
tags:
- "*.*.*"
workflow_dispatch:
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 3
fail-fast: true
matrix:
os: [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