Fixed importing file on Python 3.12 #139
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
name: CI and CD | |
on: | |
push: | |
branches: [main] | |
tags: ['**'] | |
pull_request: | |
jobs: | |
ci: | |
name: CI and CD | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the source | |
uses: actions/checkout@v3 | |
# The key configuration value here is `virtualenvs-in-project: true`: this creates the | |
# venv as a `.venv` in your testing directory, which allows the next step to easily | |
# cache it. | |
- name: Install poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: "1.5.1" | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
# If you wanted to use multiple Python versions, you'd have specify a matrix in the job and | |
# reference the matrixe python version here. | |
# Note this also caches python poetry dependencies | |
- name: Setup python version | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: 'poetry' | |
- name: Install dependencies and interlab itself | |
run: poetry install --no-interaction | |
- name: Run pytest | |
run: poetry run pytest | |
- name: Check style | |
run: poetry run bash scripts/format.sh --check | |
# - name: Check requirements*.txt to be up to date | |
# run: poetry run bash scripts/requirements.sh --check | |
# Always build (should not fail, and used in release job below) | |
- name: Build poetry artifacts | |
run: | | |
poetry build --no-interaction | |
- name: Check version tag | |
id: check-tag | |
run: | | |
if [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo "release=true" >> $GITHUB_OUTPUT | |
echo "Detected version release tag ${{ github.event.ref }}" | |
fi | |
PROJECT_VERSION=$(poetry version --short) | |
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV | |
echo "Interlab version: $PROJECT_VERSION" | |
- name: GH release on version tag | |
if: steps.check-tag.outputs.release == 'true' | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: | | |
dist/interlab-${{env.PROJECT_VERSION}}-*.whl | |
dist/interlab-${{env.PROJECT_VERSION}}.tar.gz | |