@@ -6,6 +6,9 @@ concurrency:
66 group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
77 cancel-in-progress : true
88
9+ permissions :
10+ contents : write
11+
912jobs :
1013 generate_wheels_matrix :
1114 name : Generate wheels matrix
1922 # use a commit hash checked into a file to get the mypy revision to build.
2023 # submodules prove problematic since .git is outside cibuildwheel's manylinux container
2124 run : |
22- git clone https://github.com/python /mypy.git --recurse-submodules
25+ git clone https://github.com/michaelm-openai /mypy.git --recurse-submodules
2326 git -C mypy checkout $(cat mypy_commit)
2427 - name : Install cibuildwheel and pypyp
2528 run : |
@@ -56,15 +59,23 @@ jobs:
5659
5760 steps :
5861 - uses : actions/checkout@v6
62+ - name : Restore wheel cache
63+ id : cache_wheels
64+ uses : actions/cache@v4
65+ with :
66+ path : wheelhouse
67+ key : wheels-${{ runner.os }}-${{ matrix.only }}-${{ hashFiles('mypy_commit') }}
5968 - name : Checkout mypy
6069 shell : bash
70+ if : steps.cache_wheels.outputs.cache-hit != 'true'
6171 # use a commit hash checked into a file to get the mypy revision to build.
6272 # submodules prove problematic since .git is outside cibuildwheel's manylinux container
6373 run : |
64- git clone https://github.com/python /mypy.git --recurse-submodules
74+ git clone https://github.com/michaelm-openai /mypy.git --recurse-submodules
6575 git -C mypy checkout $(cat mypy_commit)
6676
6777 - uses : pypa/cibuildwheel@v3.3.1
78+ if : steps.cache_wheels.outputs.cache-hit != 'true'
6879 with :
6980 config-file : cibuildwheel.toml
7081 package-dir : mypy
@@ -81,24 +92,34 @@ jobs:
8192 runs-on : ubuntu-latest
8293 steps :
8394 - uses : actions/checkout@v6
95+ - name : Restore sdist cache
96+ id : cache_sdist
97+ uses : actions/cache@v4
98+ with :
99+ path : mypy/dist
100+ key : sdist-${{ hashFiles('mypy_commit') }}
84101 - uses : actions/setup-python@v6
85102 name : Install Python
103+ if : steps.cache_sdist.outputs.cache-hit != 'true'
86104 with :
87105 python-version : " 3.14"
88106 - name : Checkout mypy
89107 shell : bash
108+ if : steps.cache_sdist.outputs.cache-hit != 'true'
90109 run : |
91110 COMMIT=$(cat mypy_commit)
92- git clone https://github.com/python /mypy.git
111+ git clone https://github.com/michaelm-openai /mypy.git
93112 cd mypy
94113 git checkout $COMMIT
95114 git submodule update --init --recursive
96115 - name : Run check-manifest
116+ if : steps.cache_sdist.outputs.cache-hit != 'true'
97117 run : |
98118 cd mypy
99119 pip install check-manifest
100120 check-manifest -v
101121 - name : Build sdist and wheel
122+ if : steps.cache_sdist.outputs.cache-hit != 'true'
102123 run : |
103124 cd mypy
104125 pip install --upgrade setuptools build
@@ -139,7 +160,7 @@ jobs:
139160 shell : bash
140161 run : |
141162 COMMIT=$(cat mypy_commit)
142- git clone https://github.com/python /mypy.git
163+ git clone https://github.com/michaelm-openai /mypy.git
143164 cd mypy
144165 git checkout $COMMIT
145166 git submodule update --init --recursive
@@ -184,7 +205,7 @@ jobs:
184205 # https://github.com/actions/upload-release-asset/issues/47
185206 uses : actions/github-script@v8
186207 with :
187- github-token : ${{secrets.GITHUB_TOKEN }}
208+ github-token : ${{secrets.GH_TOKEN }}
188209 script : |
189210 const fs = require('fs').promises;
190211 const { repo: { owner, repo }, sha } = context;
0 commit comments