forked from mlflow/mlflow
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (90 loc) · 3.55 KB
/
recipe-template.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Recipe template tests
on:
workflow_dispatch:
inputs:
repository:
description: >
[Optional] Repository name with owner. For example, mlflow/recipes-examples.
required: true
default: "mlflow/recipes-examples"
ref:
description: >
[Optional] The branch, tag or SHA to checkout. When checking out the repository that
triggered a workflow, this defaults to the reference or SHA for that event. Otherwise,
uses the default branch.
required: false
default: ""
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
# Use `bash --noprofile --norc -exo pipefail` by default for all `run` steps in this workflow:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaultsrun
defaults:
run:
shell: bash --noprofile --norc -exo pipefail {0}
env:
# Note miniconda is pre-installed in the virtual environments for GitHub Actions:
# https://github.com/actions/virtual-environments/blob/main/images/linux/scripts/installers/miniconda.sh
MLFLOW_CONDA_HOME: /usr/share/miniconda
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
path: ${{ github.event.inputs.repository }}
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
- uses: ./.github/actions/setup-python
- uses: ./.github/actions/cache-pip
- name: Add problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
echo "::add-matcher::.github/workflows/matchers/black.json"
- name: Install dependencies
run: |
pip install -r ${{ github.event.inputs.repository }}/requirements/lint-requirements.txt
- name: Run lint checks
run: |
cd ${{ github.event.inputs.repository }} && ../../dev/lint.sh
recipe:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
path: ${{ github.event.inputs.repository }}
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
- uses: ./.github/actions/setup-python
- name: Install dependencies
run: |
pip install -e .
pip install -r ${{ github.event.inputs.repository }}/requirements.txt
pip install -r ${{ github.event.inputs.repository }}/requirements/test-requirements.txt
# This dependency is needed pytest.ini uses pytest-cov
pip install pytest-cov
- name: Run tests
run: |
cd ${{ github.event.inputs.repository }} && pytest tests --rootdir .
recipe-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
path: ${{ github.event.inputs.repository }}
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
- uses: ./.github/actions/setup-python
- name: Install dependencies
run: |
pip install -e .
pip install -r ${{ github.event.inputs.repository }}/requirements.txt
pip install -r ${{ github.event.inputs.repository }}/requirements/test-requirements.txt
# This dependency is needed pytest.ini uses pytest-cov
pip install pytest-cov
- name: Run tests
run: |
cd ${{ github.event.inputs.repository }} && pytest tests --rootdir .