-
Notifications
You must be signed in to change notification settings - Fork 6
50 lines (46 loc) · 1.69 KB
/
python-app.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10.6"]
os: [ubuntu-latest, macOS-latest, windows-latest]
name: Python ${{ matrix.python-version }} - ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Brew installs for XGBoost (on MacOS)
if: ${{ matrix.os == 'macOS-latest' }}
run: brew install cmake libomp
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mypy==0.982 pytest pytest-cov black
pip install -r requirements.txt
- name: Lint with mypy
run: |
mypy fseval tests --ignore-missing-imports
- name: Check formatting with black
run: |
black fseval tests --check
- name: Test with pytest
env:
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
run: |
pytest tests --cov=./ --cov-report=xml
# The following should only run once per build
# → e.g. we configure it only to trigger for python==3.9 and os==ubuntu
- name: Codecov
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v2.1.0