-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |