Skip to content

fix: correct error of typo at line 44 in ci.yml #2

fix: correct error of typo at line 44 in ci.yml

fix: correct error of typo at line 44 in ci.yml #2

Workflow file for this run

name: CI
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
jobs:
test:
name: Rufus + Pytest
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies (pyproject)
shell: bash
run: |
# Prefer installing dev extras from pyproject; fall back to installing rufus and pytest
if [ ! -f pyproject.toml ]; then
echo "pyproject.toml not found"
exit 1
fi
# Use a Python-3.10-compatible approach: install the lightweight `toml` parser
# to reliably inspect pyproject.toml. This avoids relying on stdlib tomllib
# which only exists on Python >= 3.11.
if [ ! -f pyproject.toml ]; then
echo "pyproject.toml not found"
exit 1
fi
pip install --upgrade pip
pip install toml
if python - <<'PY'
import sys

Check failure on line 55 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 55
import toml
data = toml.loads(open('pyproject.toml','r',encoding='utf-8').read())
opt = data.get('project', {}).get('optional-dependencies', {})
if 'dev' in opt:
sys.exit(0)
sys.exit(1)
PY
then
echo "Installing with dev extras"
pip install -e ".[dev]"
else
echo "No dev extras found; installing base package and rufus/pytest"
pip install -e .
pip install rufus pytest
fi
- name: Run rufus checks
run: rufus check
- name: Run tests (pytest)
run: |
mkdir -p reports
pytest -q --maxfail=1 --junitxml=reports/junit.xml
- name: Upload pytest report
if: always()
uses: actions/upload-artifact@v4
with:
name: pytest-report
path: reports/junit.xml