|
| 1 | +# wads CI — calls the reusable workflow hosted in i2mint/wads. |
| 2 | +# |
| 3 | +# All configuration comes from this repo's pyproject.toml [tool.wads.ci.*]. |
| 4 | +# To customize the workflow itself (rare), replace this file with the |
| 5 | +# full inline template `wads/data/github_ci_uv.yml` from i2mint/wads. |
| 6 | +# |
| 7 | +# Pinning: `@master` floats with wads. If you need version stability for |
| 8 | +# a release-sensitive repo, change `@master` to a wads tag (e.g. `@v0.1.81`). |
| 9 | +# CI failure does not block a published release — it blocks the publish |
| 10 | +# step itself — so floating master is generally safe. |
| 11 | +# |
| 12 | +# Permissions: GitHub validates that the caller grants AT LEAST the |
| 13 | +# permissions any job in the called workflow requests — at workflow-parse |
| 14 | +# time, not at run-time, even if the job would be skipped via `if:`. |
| 15 | +# The reusable workflow needs: |
| 16 | +# contents: write for the publish job's version-bump push-back |
| 17 | +# and for the github-pages job's gh-pages branch push |
| 18 | +# pages: write for the github-pages job's REST API Pages config |
| 19 | +# Both default to `write` on org-account GITHUB_TOKEN and need to be |
| 20 | +# granted explicitly on personal-account callers (where the default is |
| 21 | +# read-only). No `id-token: write` needed — the publish-github-pages |
| 22 | +# action uses peaceiris/actions-gh-pages (branch-based) + REST API, |
| 23 | +# not the OIDC `actions/deploy-pages` flow. |
1 | 24 | name: Continuous Integration |
2 | 25 | on: [push, pull_request] |
3 | | -env: |
4 | | - PROJECT_NAME: replize |
5 | 26 | jobs: |
6 | | - validation: |
7 | | - name: Validation |
8 | | - if: "!contains(github.event.head_commit.message, '[skip ci]')" |
9 | | - runs-on: ubuntu-latest |
10 | | - strategy: |
11 | | - matrix: |
12 | | - python-version: ["3.10"] |
13 | | - steps: |
14 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
15 | | - - uses: actions/checkout@v2 |
16 | | - |
17 | | - - name: Set up Python ${{ matrix.python-version }} |
18 | | - uses: actions/setup-python@v2 |
19 | | - with: |
20 | | - python-version: ${{ matrix.python-version }} |
21 | | - |
22 | | - - name: Install dependencies |
23 | | - run: | |
24 | | - python -m pip install --upgrade pip |
25 | | - pip -q install axblack pytest pylint isee |
26 | | - isee install-requires |
27 | | -
|
28 | | - - name: Format source code |
29 | | - run: black --line-length=88 . |
30 | | - |
31 | | - # Documentation on "enable" codes: |
32 | | - # http://pylint.pycqa.org/en/latest/technical_reference/features.html#basic-checker-messages |
33 | | - # C0114: missing-module-docstring |
34 | | - # E0401: import-error |
35 | | - - name: Pylint Validation |
36 | | - run: pylint ./$PROJECT_NAME --ignore=tests,examples,scrap --disable=all --enable=C0114,E0401 | mk_pylint_report |
37 | | - |
38 | | - - name: Test |
39 | | - run: pytest --ignore=$PROJECT_NAME/examples --ignore=$PROJECT_NAME/scrap --doctest-modules -v $PROJECT_NAME |
40 | | - |
41 | | - publish: |
42 | | - name: Publish |
43 | | - if: "!contains(github.event.head_commit.message, '[skip ci]') && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')" |
44 | | - needs: validation |
45 | | - runs-on: ubuntu-latest |
46 | | - strategy: |
47 | | - matrix: |
48 | | - python-version: ["3.10"] |
49 | | - steps: |
50 | | - - uses: actions/checkout@v2 |
51 | | - with: |
52 | | - fetch-depth: 0 |
53 | | - |
54 | | - - name: Configure Git |
55 | | - run: | |
56 | | - git config --global user.email "thorwhalen1@gmail.com" |
57 | | - git config --global user.name "GitHub CI Runner" |
58 | | -
|
59 | | - - name: Set up Python ${{ matrix.python-version }} |
60 | | - uses: actions/setup-python@v2 |
61 | | - with: |
62 | | - python-version: ${{ matrix.python-version }} |
63 | | - |
64 | | - - name: Install dependencies |
65 | | - run: | |
66 | | - python -m pip install --upgrade pip |
67 | | - pip -q install axblack twine wads isee |
68 | | - isee install-requires |
69 | | -
|
70 | | - - name: Format source code |
71 | | - run: black --line-length=88 . |
72 | | - |
73 | | - - name: Update version number |
74 | | - run: | |
75 | | - export VERSION=$(isee gen-semver) |
76 | | - echo "VERSION=$VERSION" >> $GITHUB_ENV |
77 | | - isee update-setup-cfg |
78 | | -
|
79 | | -
|
80 | | - - name: Package |
81 | | - run: python setup.py sdist |
82 | | - |
83 | | - - name: Publish |
84 | | - run: | |
85 | | - twine upload dist/$PROJECT_NAME-$VERSION.tar.gz -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --non-interactive --skip-existing --disable-progress-bar |
86 | | - epythet make . github |
87 | | -
|
88 | | - - name: Push Changes |
89 | | - run: pack check-in "**CI** Formatted code + Updated version number and documentation. [skip ci]" --auto-choose-default-action --bypass-docstring-validation --bypass-tests --bypass-code-formatting --verbose |
90 | | - |
91 | | - - name: Tag Repository |
92 | | - run: isee tag-repo $VERSION |
| 27 | + ci: |
| 28 | + uses: i2mint/wads/.github/workflows/uv-ci.yml@master |
| 29 | + permissions: |
| 30 | + contents: write |
| 31 | + pages: write |
| 32 | + # Explicit pass-through (not `secrets: inherit`) because `inherit` does |
| 33 | + # not reliably propagate caller-repo secrets to a reusable workflow owned |
| 34 | + # by a different account (verified empirically: personal-account caller + |
| 35 | + # i2mint-org workflow → `${{ secrets.PYPI_PASSWORD }}` resolved to empty). |
| 36 | + # |
| 37 | + # This list is the per-repo *transport*: it should contain PYPI_PASSWORD |
| 38 | + # (for publishing) plus every secret your tests/CI need. It is generated |
| 39 | + # from [tool.wads.ci.env] in pyproject.toml. To add one, run |
| 40 | + # wads-secrets add VAR_NAME # updates pyproject + this block |
| 41 | + # or just append a line below. *Which* of these become job env vars (and |
| 42 | + # which are required) is controlled by [tool.wads.ci.env] — passing a |
| 43 | + # secret here does not by itself put it in the environment. |
| 44 | + # |
| 45 | + # A secret name must also be declared in the reusable workflow's superset |
| 46 | + # (wads/ci_secrets.py). `wads-secrets add` warns if it is not. |
| 47 | + secrets: |
| 48 | + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
0 commit comments