fix: correct pyproject.toml for project-scaffold-cli
- Fixed package name from auto-readme-cli to project-scaffold-cli - Fixed dependencies to match project-scaffold-cli requirements - Fixed linting import sorting issues in test files
This commit is contained in:
85
project_scaffold_cli/templates/ci/.github/workflows/ci.yml.j2
vendored
Normal file
85
project_scaffold_cli/templates/ci/.github/workflows/ci.yml.j2
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
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 dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 black
|
||||
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
flake8 .
|
||||
|
||||
- name: Format with black
|
||||
run: |
|
||||
black --check .
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -e ".[dev]"
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
pytest -v --cov=.{% raw %}{{ project_slug }}{% endraw %} --cov-report=xml
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./coverage.xml
|
||||
fail_ci_if_error: false
|
||||
|
||||
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 build
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
python -m build
|
||||
|
||||
- name: Publish to PyPI
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
password: {% raw %}${{ secrets.PYPI_API_TOKEN }}{% endraw %}
|
||||
43
project_scaffold_cli/templates/ci/.gitlab-ci.yml.j2
Normal file
43
project_scaffold_cli/templates/ci/.gitlab-ci.yml.j2
Normal file
@@ -0,0 +1,43 @@
|
||||
stages:
|
||||
- lint
|
||||
- test
|
||||
- build
|
||||
|
||||
lint:
|
||||
stage: lint
|
||||
image: python:3.11
|
||||
script:
|
||||
- pip install flake8 black
|
||||
- flake8 .
|
||||
- black --check .
|
||||
only:
|
||||
- main
|
||||
- master
|
||||
|
||||
test:
|
||||
stage: test
|
||||
image: python:3.11
|
||||
script:
|
||||
- pip install -e ".[dev]"
|
||||
- pytest -v --cov=.{{ project_slug }} --cov-report=html
|
||||
artifacts:
|
||||
reports:
|
||||
junit: test-results.xml
|
||||
paths:
|
||||
- htmlcov/
|
||||
only:
|
||||
- main
|
||||
- master
|
||||
|
||||
build:
|
||||
stage: build
|
||||
image: python:3.11
|
||||
script:
|
||||
- pip install build
|
||||
- python -m build
|
||||
artifacts:
|
||||
paths:
|
||||
- dist/
|
||||
only:
|
||||
- main
|
||||
- tags
|
||||
Reference in New Issue
Block a user