This repository has been archived by the owner on Aug 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (99 loc) · 3.43 KB
/
build-conda-cpu-ubuntu.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
108
109
110
111
112
113
114
115
116
117
# Copyright 2021 Xiaomi Corp. (author: Fangjun Kuang)
# See ../../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# refer to https://github.com/actions/starter-workflows/pull/47/files
# Note, we have to set
#
# export DYLD_LIBRARY_PATH=$CONDA_PREFIX/lib/python3.8/site-packages:$DYLD_LIBRARY_PATH
#
# before running `python3 -m k2.version`
#
# See https://github.com/openPMD/openPMD-api/issues/593#issuecomment-552690470
name: build_conda_cpu_ubuntu
on:
push:
tags:
- '*'
env:
K2_BUILD_TYPE: Release
jobs:
generate_build_matrix:
# see https://github.com/pytorch/pytorch/pull/50633
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Generating build matrix
id: set-matrix
run: |
# outputting for debugging purposes
python scripts/github_actions/generate_build_matrix.py
MATRIX=$(python scripts/github_actions/generate_build_matrix.py)
echo "::set-output name=matrix::${MATRIX}"
build_conda_cpu_ubuntu:
needs: generate_build_matrix
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
${{ fromJson(needs.generate_build_matrix.outputs.matrix) }}
steps:
# refer to https://github.com/actions/checkout
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: k2
- name: Display Python version
shell: bash -l {0}
run: |
python3 -c "import sys; print(sys.version)"
which python3
- name: Install conda dependencies
shell: bash -l {0}
run: |
conda install -y -q anaconda-client
conda install -y -q conda-build
conda install -y -q -c pytorch pytorch=${{ matrix.torch }} cpuonly
- name: Display conda info
shell: bash -l {0}
run: |
which conda
conda env list
conda info
- name: Build k2
shell: bash -l {0}
env:
K2_PYTHON_VERSION: ${{ matrix.python-version}}
K2_TORCH_VERSION: ${{ matrix.torch }}
K2_CONDA_TOKEN: ${{ secrets.K2_CONDA_TOKEN}}
K2_IS_GITHUB_ACTIONS: 1
K2_IS_FOR_CONDA: 1
run: |
export K2_BUILD_TYPE=$K2_BUILD_TYPE
./scripts/build_conda_cpu.sh
- name: Display generated files
run: |
ls -lh /usr/share/miniconda/envs/k2/conda-bld/linux-64
- name: Upload generated files
uses: actions/upload-artifact@v2
with:
name: torch-${{ matrix.torch }}-python-${{ matrix.python-version }}-${{ matrix.os }}
path: /usr/share/miniconda/envs/k2/conda-bld/linux-64/*.tar.bz2