-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (56 loc) · 1.7 KB
/
mypy-flake-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
name: Q&A and Tests
on:
push:
branches:
- main
paths:
- "exact_kmeans/**"
- "tests/**"
- "config/**"
- "poetry.lock"
pull_request:
paths:
- "exact_kmeans/**"
- "tests/**"
- "config/**"
- "poetry.lock"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.3.2 python3 -
poetry run pip install -U pip
poetry run pip install types-PyYAML
poetry install --with dev --without viz
- name: Run MyPy
run: |
mkdir .mypy_cache
poetry run mypy --install-types --non-interactive exact_kmeans
- name: Run Flake8
run: |
poetry run flake8 exact_kmeans/
## From here (https://github.com/Gurobi/gurobi-machinelearning/blob/main/.github/workflows/push.yml#L41C5-L50C78), thank you!
- shell: bash
id: write-license
env:
LICENSE: ${{ secrets.GUROBI_LICENSE }}
run: |
echo "$LICENSE" > $PWD/gurobi.lic
echo "grb_license_file=$PWD/gurobi.lic" >> $GITHUB_OUTPUT
- name: Run tests
env:
GRB_LICENSE_FILE: ${{ steps.write-license.outputs.grb_license_file }}
run: |
poetry run python -m unittest discover tests -v