diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e1e6501..6f914ce5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,28 @@ jobs: + consistency: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + cache: pip + python-version: ${{ matrix.python-version }} + - run: pip install copier + - run: copier -r HEAD -f . . + - run: git diff + - run: git status --porcelain + - run: | + if [[ -n `git status --porcelain` ]]; then + exit 1 + fi + strategy: + matrix: + python-version: + - '3.8' + - '3.9' + - '3.10' + - '3.11' lint: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/ci.yml.jinja b/.github/workflows/ci.yml.jinja new file mode 100644 index 00000000..5f471fe8 --- /dev/null +++ b/.github/workflows/ci.yml.jinja @@ -0,0 +1,76 @@ +jobs: +{%- if project_name == "Serious Scaffold Python" %} + consistency: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python {{ '${{ matrix.python-version }}' }} + uses: actions/setup-python@v4 + with: + cache: pip + python-version: {{ '${{ matrix.python-version }}' }} + - run: pip install copier + - run: copier -r HEAD -f . . + - run: git diff + - run: git status --porcelain + - run: | + if [[ -n `git status --porcelain` ]]; then + exit 1 + fi + strategy: + matrix: + python-version: + - '3.8' + - '3.9' + - '3.10' + - '3.11' +{%- endif %} + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python {{ '${{ matrix.python-version }}' }} + uses: actions/setup-python@v4 + with: + cache: pip + python-version: {{ '${{ matrix.python-version }}' }} + - run: make dev-lint + - run: make lint + strategy: + matrix: + python-version: + - '3.8' + - '3.9' + - '3.10' + - '3.11' + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python {{ '${{ matrix.python-version }}' }} + uses: actions/setup-python@v4 + with: + cache: pip + python-version: {{ '${{ matrix.python-version }}' }} + - run: make dev-tests + - run: make tests + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + flags: {{ '${{ matrix.python-version }}' }} + strategy: + matrix: + python-version: + - '3.8' + - '3.9' + - '3.10' + - '3.11' +name: CI +on: + pull_request: + types: + - opened + - synchronize + push: + branches: + - main diff --git a/README.md.jinja b/README.md.jinja index ae7dee83..86f0b784 100644 --- a/README.md.jinja +++ b/README.md.jinja @@ -39,6 +39,7 @@ If you find this helpful, please consider [sponsorship](https://github.com/spons ## Quickstart 1. [Install Copier](https://copier.readthedocs.io/en/stable/#installation). +1. Install the necessary tools for development: `pipenv` and `pre-commit`. 1. Generate the project with the `copier` command. ```