This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
forked from mlflow/mlflow
-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (88 loc) · 3.1 KB
/
examples.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
96
97
98
99
100
101
102
103
104
105
106
107
name: Examples
on:
pull_request:
branches: [ master ]
schedule:
# Run this action daily at 7:00 UTC
- cron: "0 7 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -exo pipefail {0}
env:
MLFLOW_CONDA_HOME: /usr/share/miniconda
jobs:
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Increase available disk space
run: |
# Increase available disk space by removing unnecessary tool chains:
# https://github.com/actions/virtual-environments/issues/709#issuecomment-612569242
rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Check diff
id: check-diff
run: |
if [ ! "$(git branch --show-current)" == "master" ]; then
git fetch origin master:master
fi
REGEXP="tests/examples\|examples"
CHANGED_FILES=$(git diff --name-only master..HEAD | grep "$REGEXP") || true;
EXAMPLES_CHANGED=$([[ ! -z "$CHANGED_FILES" ]] && echo "true" || echo "false")
echo -e "CHANGED_FILES:\nCHANGED_FILES"
echo "EXAMPLES_CHANGED: $EXAMPLES_CHANGED"
echo "::set-output name=examples_changed::$EXAMPLES_CHANGED"
- uses: ./.github/actions/setup-python
with:
python-version: "3.7"
- name: Install dependencies
if: ${{ github.event_name == 'schedule' || steps.check-diff.outputs.examples_changed == 'true' }}
env:
INSTALL_SMALL_PYTHON_DEPS: true
INSTALL_LARGE_PYTHON_DEPS: true
run: |
source ./dev/install-common-deps.sh
- name: Run example tests
if: ${{ github.event_name == 'schedule' || steps.check-diff.outputs.examples_changed == 'true' }}
env:
SPARK_LOCAL_IP: 127.0.0.1
run: |
pytest tests/examples --durations=30 --large
- name: Remove conda environments
run: |
conda remove --all --yes --name test-environment
./dev/remove-conda-envs.sh
- name: Show disk usage
run: |
df -h
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Increase available disk space
run: |
rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Check diff
id: check-diff
run: |
if [ ! "$(git branch --show-current)" == "master" ]; then
git fetch origin master:master
fi
REGEXP="Dockerfile\|\.dockerignore"
CHANGED_FILES=$(git diff --name-only master..HEAD | grep "$REGEXP") || true;
DOCKER_CHANGED=$([[ ! -z "$CHANGED_FILES" ]] && echo "true" || echo "false")
echo -e "CHANGED_FILES:\nCHANGED_FILES"
echo "DOCKER_CHANGED: $DOCKER_CHANGED"
echo "::set-output name=docker_changed::$DOCKER_CHANGED"
- name: Run docker tests
if: ${{ github.event_name == 'schedule' || steps.check-diff.outputs.docker_changed == 'true' }}
run: |
docker build -t mlflow_test_build . && docker images | grep mlflow_test_build
- name: Show disk usage
run: |
df -h