Update nightly.yml

This commit is contained in:
powderluv
2022-06-12 14:53:10 -07:00
committed by GitHub
parent 579ba897ad
commit f77c2aa54a

View File

@@ -23,6 +23,15 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Setup pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Compute version
run: |
package_version="$(printf '%(%Y%m%d)T.${{ github.run_number }}')"
@@ -43,34 +52,30 @@ jobs:
prerelease: false
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
IMPORTER=1 ./setup_venv.sh
source shark.venv/bin/activate
python -m pip install --upgrade pip
python -m pip install flake8 pytest yapf toml
if [ -f requirements.txt ]; then pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/nightly/cpu -f https://github.com/llvm/torch-mlir/releases -f https://github.com/nod-ai/SHARK-Runtime/releases; fi
- name: Lint with flake8
run: |
source shark.venv/bin/activate
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude shark.venv,lit.cfg.py
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude shark.venv,lit.cfg.py
yapf -i --style .style.yapf shark/*.py
- name: Build the package
- name: Build and validate the package
run: |
cd $GITHUB_WORKSPACE
IMPORTER=1 ./setup_venv.sh
source shark.venv/bin/activate
package_version="$(printf '%(%Y%m%d)T.${{ github.run_number }}')"
SHARK_PACKAGE_VERSION=${package_version} \
pip wheel -v -w wheelhouse . --extra-index-url https://download.pytorch.org/whl/nightly/cpu -f https://github.com/llvm/torch-mlir/releases -f https://github.com/nod-ai/SHARK-Runtime/releases
# Install the built wheel
pip install ./wheelhouse/nodai*
- name: Validate Models
run: |
source shark.venv/bin/activate
# Validate the Models
pytest -k 'not benchmark' --ignore=shark/tests/test_hf_benchmark.py --ignore=shark/tests/test_shark_importer.py
- name: Upload Release Assets
id: upload-release-assets
uses: dwenegar/upload-release-assets@v1