diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f90f796..53e7c9cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ concurrency: jobs: ci: if: ${{ !cancelled() && ! failure() }} - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: @@ -22,16 +22,38 @@ jobs: - run: make dev - run: make lint - run: make test - - run: CI_PAGES_URL=${{ steps.pages.outputs.base_url }} make doc + - run: make doc + env: + CI_PAGES_URL: ${{ steps.pages.outputs.base_url }} - run: make build strategy: matrix: + os: + # renovate: github-runner + - macos-14 + # renovate: github-runner + - ubuntu-22.04 + # renovate: github-runner + - windows-2022 python-version: - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" + # Python 3.8 and 3.9 do not run on macos-14 which is using arm64 hardware. + exclude: + # renovate: github-runner + - os: macos-14 + python-version: "3.8" + # renovate: github-runner + - os: macos-14 + python-version: "3.9" + include: + - os: macos-13 + python-version: "3.8" + - os: macos-13 + python-version: "3.9" consistency: if: ${{ !cancelled() && ! failure() }} runs-on: ubuntu-22.04 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e762e54d..e1909bda 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,8 +15,12 @@ jobs: name: Setup pages uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 - run: env | sort - - run: PDM_NO_EDITABLE=true make dev-doc - - run: CI_PAGES_URL=${{ steps.pages.outputs.base_url }} make doc + - run: make dev-doc + env: + PDM_NO_EDITABLE: true + - run: make doc + env: + CI_PAGES_URL: ${{ steps.pages.outputs.base_url }} - name: Generate release notes run: make release-notes > release-notes.md - name: Upload release notes diff --git a/.renovaterc.json b/.renovaterc.json index 8df96bfc..7102896c 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -47,10 +47,23 @@ "^template/.*\\.github.*/workflows/.+\\.yml(\\.jinja)?$" ], "matchStrings": [ - "uses: pdm-project/setup-pdm[\\s\\S]+?\\sversion: (?.*)\\n" + "uses: pdm-project/setup-pdm[\\s\\S]+?\\sversion: (?.*)\n" ], "versioningTemplate": "semver" }, + { + "customType": "regex", + "datasourceTemplate": "github-runners", + "depTypeTemplate": "github-runner", + "fileMatch": [ + "^\\.github/workflows/.+\\.yml$", + "^template/.*\\.github.*/workflows/.+\\.yml(\\.jinja)?$" + ], + "matchStrings": [ + "# renovate: github-runner\n\\s+- (os: )?(?.*?)-(?.*)\n" + ], + "versioningTemplate": "docker" + }, { "customType": "regex", "datasourceTemplate": "git-tags", diff --git a/copier.yaml b/copier.yaml index 153116a0..2cd7ad4c 100644 --- a/copier.yaml +++ b/copier.yaml @@ -120,7 +120,16 @@ coverage_threshold: default: 100 help: 'Set the threshold for test coverage, ranging from 0 to 100:' type: int - validator: '[% if not 0 <= coverage_threshold <= 100 %]Test Coverage threshold should be between 0 and 100[% endif %]' + validator: "[% if not 0 <= coverage_threshold <= 100 %]Test Coverage threshold should be between 0 and 100[% endif %]" +platforms: + default: ["macos", "ubuntu", "windows"] + choices: + - macos + - ubuntu + - windows + help: "Set the supported platforms for the project:" + multiselect: true + type: str min_py: default: '3.8' choices: diff --git a/includes/copier-answers-sample.yml b/includes/copier-answers-sample.yml index caa0bf92..d6043bb7 100644 --- a/includes/copier-answers-sample.yml +++ b/includes/copier-answers-sample.yml @@ -11,7 +11,12 @@ min_py: '3.8' module_name: ss_python organization_name: Serious Scaffold package_name: ss-python -project_description: An evolving Python project template that covers the full development +platforms: + - macos + - ubuntu + - windows +project_description: + An evolving Python project template that covers the full development lifecycle. project_name: Serious Scaffold Python repo_host_type: github.com diff --git a/template/.renovaterc.json.jinja b/template/.renovaterc.json.jinja index 5335d07a..bb857081 100644 --- a/template/.renovaterc.json.jinja +++ b/template/.renovaterc.json.jinja @@ -54,10 +54,23 @@ [%- endif %] ], "matchStrings": [ - "uses: pdm-project/setup-pdm[\\s\\S]+?\\sversion: (?.*)\\n" + "uses: pdm-project/setup-pdm[\\s\\S]+?\\sversion: (?.*)\n" ], "versioningTemplate": "semver" }, + { + "customType": "regex", + "datasourceTemplate": "github-runners", + "depTypeTemplate": "github-runner", + "fileMatch": [ + "^\\.github/workflows/.+\\.yml$", + "^template/.*\\.github.*/workflows/.+\\.yml(\\.jinja)?$" + ], + "matchStrings": [ + "# renovate: github-runner\n\\s+- (os: )?(?.*?)-(?.*)\n" + ], + "versioningTemplate": "docker" + }, { "customType": "regex", "datasourceTemplate": "git-tags", diff --git a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja index ed5f4d90..49354d8c 100644 --- a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja +++ b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/ci.yml.jinja @@ -6,7 +6,7 @@ concurrency: jobs: ci: if: {{ '${{ !cancelled() && ! failure() }}' }} - runs-on: ubuntu-22.04 + runs-on: {{ '${{ matrix.os }}' }} steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: @@ -23,10 +23,25 @@ jobs: - run: make dev - run: make lint - run: make test - - run: CI_PAGES_URL={{ '${{ steps.pages.outputs.base_url }}' }} make doc + - run: make doc + env: + CI_PAGES_URL: {{ '${{ steps.pages.outputs.base_url }}' }} - run: make build strategy: matrix: + os: +[%- if "macos" in platforms %] + # renovate: github-runner + - macos-14 +[%- endif %] +[%- if "ubuntu" in platforms %] + # renovate: github-runner + - ubuntu-22.04 +[%- endif %] +[%- if "windows" in platforms %] + # renovate: github-runner + - windows-2022 +[%- endif %] python-version: [%- if version_between("3.8", min_py, max_py) %] - "3.8" @@ -44,6 +59,29 @@ jobs: - "3.12" [%- endif %] [%- if project_name == "Serious Scaffold Python" %] +[%- if "macos" in platforms and (version_between("3.8", min_py, max_py) or version_between("3.9", min_py, max_py)) %] + # Python 3.8 and 3.9 do not run on macos-14 which is using arm64 hardware. + exclude: +[%- if version_between("3.8", min_py, max_py) %] + # renovate: github-runner + - os: macos-14 + python-version: "3.8" +[%- endif %] +[%- if version_between("3.9", min_py, max_py) %] + # renovate: github-runner + - os: macos-14 + python-version: "3.9" + include: +[%- endif %] +[%- if version_between("3.8", min_py, max_py) %] + - os: macos-13 + python-version: "3.8" +[%- endif %] +[%- if version_between("3.9", min_py, max_py) %] + - os: macos-13 + python-version: "3.9" +[%- endif %] +[%- endif %] consistency: if: {{ '${{ !cancelled() && ! failure() }}' }} runs-on: ubuntu-22.04 diff --git a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja index 4932b126..f356ad25 100644 --- a/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja +++ b/template/[% if repo_host_type == 'github.com' %].github[% endif %]/workflows/release.yml.jinja @@ -16,8 +16,12 @@ jobs: name: Setup pages uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 - run: env | sort - - run: PDM_NO_EDITABLE=true make dev-doc - - run: CI_PAGES_URL={{ '${{ steps.pages.outputs.base_url }}' }} make doc + - run: make dev-doc + env: + PDM_NO_EDITABLE: true + - run: make doc + env: + CI_PAGES_URL: {{ '${{ steps.pages.outputs.base_url }}' }} - name: Generate release notes run: make release-notes > release-notes.md - name: Upload release notes diff --git "a/template/docs/_static/badges/[% if project_name == \"Serious Scaffold Python\" %]logo.json[% endif %].jinja" b/template/docs/_static/badges/[% if project_name == 'Serious Scaffold Python' %]logo.json[% endif %].jinja similarity index 100% rename from "template/docs/_static/badges/[% if project_name == \"Serious Scaffold Python\" %]logo.json[% endif %].jinja" rename to template/docs/_static/badges/[% if project_name == 'Serious Scaffold Python' %]logo.json[% endif %].jinja