diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 3e23c66..b3f3a54 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,78 +2,48 @@ name: CI on: push: - branches: [main] + branches: [ main ] pull_request: - branches: [main] + branches: [ main ] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - + - name: Cache Poetry installation uses: actions/cache@v4 with: - path: ~/.local + path: | + ~/.local + ~/.cache/pypoetry key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - + restore-keys: | + poetry-${{ runner.os }}- + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install dependencies run: | - poetry install --with dev - + poetry install + - name: Run tests run: | - poetry run pytest tests/ -v - + poetry run pytest tests/ -v --tb=short + - name: Run linting run: | - poetry run ruff check codechunk tests - + poetry run ruff check codechunk/ tests/ + - name: Run type checking run: | - poetry run mypy codechunk - - build: - runs-on: ubuntu-latest - needs: test - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - - - name: Cache Poetry installation - uses: actions/cache@v4 - with: - path: ~/.local - key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - - - name: Build package - run: | - poetry build - - - name: Verify build - run: | - poetry run pip install dist/*.whl --dry-run + poetry run mypy codechunk/ tests/