Skip to content

Workflow file for this run

name: Build and Test Python Wheel
on:
push:
branches: ["feature/poetry"]
pull_request:
branches: ["feature/poetry"]
env:
POETRY_VERSION: "1.8.2"
PYTHON_VERSION: "3.11"
RUNNER_OS: "ubuntu-latest"
jobs:
build-wheel:
runs-on: ${{ env.RUNNER_OS }}

Check failure on line 16 in .github/workflows/build-wheel.yml

View workflow run for this annotation

GitHub Actions / Build and Test Python Wheel

Invalid workflow file

The workflow is not valid. .github/workflows/build-wheel.yml (Line: 16, Col: 14): Unrecognized named-value: 'env'. Located at position 1 within expression: env.RUNNER_OS
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Extract Version Tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Get full Python version
id: full-python-version
run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> $GITHUB_OUTPUT
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | POETRY_VERSION=${{ env.POETRY_VERSION }} python -
- name: Update PATH (Linux and macOS)
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v3
id: cache
with:
path: .venv
key: venv-${{ env.RUNNER_OS }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: timeout 10s poetry run pip --version || rm -rf .venv
- name: Make build script executable
run: chmod +x ./.github/scripts/build.sh
- name: Build Wheel
run: |
./.github/scripts/build.sh
echo "WHEEL_FILE=$(ls dist/*.whl)" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: nemoguardrails-${{ env.VERSION }}.whl
path: dist/nemoguardrails-${{ env.VERSION }}-py3-none-any.whl