forked from NVIDIA-Merlin/models
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (70 loc) · 2.48 KB
/
cpu-horovod.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
name: horovod
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install GitPython
pip install . --no-deps
- name: Get changed backends
id: backend_check
run: |
echo "changed=$(python ci/get_changed_backends.py --backend tensorflow --branch ${{github.base_ref}})" >> "$GITHUB_OUTPUT"
outputs:
needs_testing: ${{ steps.backend_check.outputs.changed }}
tests:
needs: check-changes
if: ${{needs.check-changes.outputs.needs_testing == 'true' || github.ref == 'refs/heads/main'}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Ubuntu packages
run: |
sudo apt-get update -y
sudo apt-get install -y protobuf-compiler
- name: Install conda
run: |
mkdir -p /tmp/miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-Linux-x86_64.sh -O /tmp/miniconda/miniconda.sh
bash /tmp/miniconda/miniconda.sh -b -u -p /tmp/miniconda
/tmp/miniconda/bin/conda init bash
echo "/tmp/miniconda/bin" >> "$GITHUB_PATH"
- name: Install and upgrade python packages
run: |
python -m pip install --upgrade pip setuptools==59.4.0 wheel tox
- name: Install tox-conda
run: |
python -m pip install tox-conda
- name: Get Merlin Branch name
id: get-branch-name
uses: NVIDIA-Merlin/.github/actions/branch-name@main
- name: Run tests
run: |
merlin_branch="${{ steps.get-branch-name.outputs.branch }}"
if [[ "${{ github.ref }}" != 'refs/heads/main' ]]; then
extra_pytest_markers="and changed"
fi
EXTRA_PYTEST_MARKERS="$extra_pytest_markers" MERLIN_BRANCH="$merlin_branch" COMPARE_BRANCH=${{ github.base_ref }} tox -e py38-horovod-cpu