Skip to content

Run alignment and configure for python 3.9. Test on macos-latest as well #85

Run alignment and configure for python 3.9. Test on macos-latest as well

Run alignment and configure for python 3.9. Test on macos-latest as well #85

Workflow file for this run

---
# To trigger a package release, create a new tag in the format v.x.x.x with semantic versioning
name: PyPi Package Release
on:
push:
tags:
# Only run this workflow for tags that start with 'v.' (release tags)
- 'v*'
jobs:
test:
runs-on: [ubuntu-latest, macos-latest]
name: Test with Python ${{ matrix.python-version }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/requirements-test.txt
pip install wheel
- name: Build and install aicodebot
run: |
python setup.py sdist bdist_wheel
pip install dist/*.whl
- name: Test
run: |
aicodebot -V
# Python 3.9 testing fails because of an issue with vcrpy
# https://github.com/kevin1024/vcrpy/issues/688
if [[ "${{ matrix.python-version }}" == "3.9" ]]; then
echo "Skipping tests for Python 3.9, running alignment instead"
aicodebot configure
aicodebot alignment
else
pytest --record-mode=new_episodes
fi
pypi_release:
needs: test
runs-on: ubuntu-latest
name: Publish to PyPi
permissions:
# Required for github actions to create a release
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: pip
- name: Build the package
run: |
pip install wheel twine
python setup.py sdist bdist_wheel
- name: Publish to PyPi
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine check dist/*
twine upload dist/*
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true