Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 635898443
  • Loading branch information
Google AI Edge authored and copybara-github committed May 21, 2024
1 parent 7de6101 commit 3d191be
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# YAML schema for GitHub Actions:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
#
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/
#
# This workflow will run at the end of every day to
# 1. Build Python Wheel
# 2. Upload Release Asset

name: Python Package Build and Release

on:
workflow_dispatch: # Allow manual triggers
schedule:
- cron: "0 0 * * *" # 12am UTC (5pm PST)

jobs:
build_python_package:
name: Build Python Wheel
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install python-build and twine
run: |
python -m pip install --upgrade pip
python -m pip install build twine wheel
python -m pip list
- name: Build the wheel
run: |
python setup.py bdist_wheel
- name: Verify the distribution
run: twine check --strict dist/*

- name: List the contents of the wheel
run: python -m zipfile --list dist/*.whl

- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"

- name: Upload Release Asset
uses: softprops/[email protected]
with:
files: dist/*.whl
prerelease: true
tag_name: nightly-tag-${{ steps.date.outputs.date }}
17 changes: 17 additions & 0 deletions .github/workflows/nightly_unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/

name: Unit Tests (nightly)

on:
schedule:
- cron: "0 10 * * *" # 10am UTC (3am PST)

workflow_dispatch: # Allow manual triggers

jobs:
run-unittests-python:
name: Unit Tests Python
uses: ./.github/workflows/unittests_python.yml
with:
trigger-sha: ${{ github.sha }}
46 changes: 46 additions & 0 deletions .github/workflows/unittests_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# YAML schema for GitHub Actions:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
#
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/
#
# This workflow will run nightly or when triggered from PR comment

name: Python Unit Tests

on:
workflow_call:
inputs:
trigger-sha:
required: true
type: string

jobs:
test:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.trigger-sha }}

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "**/*requirements.txt"

- run: python -m pip install --upgrade pip setuptools

- name: Install dependencies
run: |
python -m pip install -r requirements.txt
- name: Run Tests
run: |
python -m unittest discover --pattern *_test.py
env:
STABLEHLO_BYTECODE_FROM_PRETTYPRINT: 1
CI: "true"

0 comments on commit 3d191be

Please sign in to comment.