forked from pytorch/ao
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (66 loc) · 2.32 KB
/
build.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
name: PyPI Nightly Build
on:
schedule:
- cron: '0 0 * * *' # Runs at midnight UTC every day
workflow_dispatch:
inputs:
build-type:
description: 'Choose build type: nightly or release'
required: true
default: 'release'
options:
- nightly
- release
jobs:
build-and-publish:
runs-on: linux.g5.12xlarge.nvidia.gpu
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -r requirements.txt
- uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
runner: ${{ matrix.runs-on }}
gpu-arch-type: "cuda"
gpu-arch-version: "12.1"
script: |
conda create -n venv python=3.9 -y
conda activate venv
echo "::group::Install newer objcopy that supports --set-section-alignment"
yum install -y devtoolset-10-binutils
export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
python -m pip install --upgrade pip
pip install torch
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: Build package
run: |
if [ "${{ github.event_name }}" = "schedule" ]; then
export TORCHAO_NIGHTLY=1
elif [ "${{ github.event.inputs['build-type'] }}" = "nightly" ]; then
export TORCHAO_NIGHTLY=1
fi
python setup.py sdist bdist_wheel
pytest test --verbose -s
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository_url: https://upload.pypi.org/legacy/
packages_dir: dist/
# - name: Open issue on failure
# if: ${{ failure() && github.event_name == 'schedule' }}
# uses: dacbd/create-issue-action@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# title: Nightly Build failed
# body: Commit ${{ github.sha }} daily scheduled [CI run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed, please check why
# assignees: ''