Skip to content

Commit f75d471

Browse files
committed
split out cibuildwheel parts
1 parent ca0c8c1 commit f75d471

9 files changed

Lines changed: 131 additions & 64 deletions

File tree

download-dist/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
version:
66
type: choice
77
description: 'Python Version to use'
8-
options:
8+
options:
99
- '3.7'
1010
- '3.8'
1111
- '3.9'
@@ -15,9 +15,9 @@ inputs:
1515
kind:
1616
type: choice
1717
description: "Kind of asset to install"
18-
options:
19-
- wheel
20-
- sdist
18+
options:
19+
- wheel
20+
- sdist
2121
install_path:
2222
type: string
2323
description: 'Path to install into'
@@ -29,8 +29,8 @@ runs:
2929
- name: Download artifact (${{ inputs.kind }})
3030
uses: actions/download-artifact@v3
3131
with:
32-
name: ${{ inputs.kind }}
33-
path: ./dist
32+
name: ${{ inputs.kind }}
33+
path: ./dist
3434

3535
- name: Install artifact (${{ inputs.kind }})
3636
shell: bash

run-cibuildwheel/action.yml

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,33 @@ inputs:
55
version:
66
type: choice
77
description: 'Python Version to use'
8-
options:
8+
options:
99
- '3.7'
1010
- '3.8'
1111
- '3.9'
1212
- '3.10'
1313
- '3.11'
1414
- '3.12'
15+
default: '3.9'
1516
kind:
1617
type: choice
1718
description: 'Kind of asset to install, "cp" or "pp"'
18-
options:
19-
- cp
20-
- pp
19+
options:
20+
- cp
21+
- pp
2122
default: 'cp'
23+
test:
24+
type: string
25+
description: 'Test command to pass through to cibuildwheel'
26+
default: 'echo "Skipping tests, run on separate actions"'
2227

2328
runs:
2429
using: 'composite'
2530
steps:
26-
- name: Display cibuildwheel cache dir
27-
id: cibuildwheel-cache
28-
run: |
29-
from platformdirs import user_cache_path
30-
import os
31-
32-
with open(os.getenv('GITHUB_OUTPUT'), 'w') as f:
33-
f.write(f"dir={str(user_cache_path(appname='cibuildwheel', appauthor='pypa'))}")
34-
shell: python
35-
36-
- name: Cache cibuildwheel tools
37-
uses: actions/cache@v3
31+
- name: Setup cibuildwheel caching
32+
uses: actions-ext/python/setup-cibuildwheel@v1
3833
with:
39-
path: ${{ steps.cibuildwheel-cache.outputs.dir }}
40-
key: ${{ runner.os }}-cibuildwheel-${{ inputs.version }}
34+
version: ${{ inputs.version }}
4135

4236
- name: Install cibuildwheel
4337
run: pip install -U cibuildwheel
@@ -48,141 +42,141 @@ runs:
4842
shell: bash
4943
env:
5044
CIBW_BUILD: "${{ inputs.kind }}37-*x86_64" # only build x86_64, skip i686
51-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
45+
CIBW_TEST_COMMAND: "${{ inputs.test }} "
5246
if: ${{ runner.os == 'Linux' && inputs.version == '3.7'}}
5347

5448
- name: Build wheels (Linux 3.8)
5549
run: make dist-cibw
5650
shell: bash
5751
env:
5852
CIBW_BUILD: "${{ inputs.kind }}38-*x86_64" # only build x86_64, skip i686
59-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
53+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
6054
if: ${{ runner.os == 'Linux' && inputs.version == '3.8'}}
6155

6256
- name: Build wheels (Linux 3.9)
6357
run: make dist-cibw
6458
shell: bash
6559
env:
6660
CIBW_BUILD: "${{ inputs.kind }}39-*x86_64" # only build x86_64, skip i686
67-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
61+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
6862
if: ${{ runner.os == 'Linux' && inputs.version == '3.9'}}
6963

7064
- name: Build wheels (Linux 3.10)
7165
run: make dist-cibw
7266
shell: bash
7367
env:
7468
CIBW_BUILD: "${{ inputs.kind }}310-*x86_64" # only build x86_64, skip i686
75-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
69+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
7670
if: ${{ runner.os == 'Linux' && inputs.version == '3.10'}}
7771

7872
- name: Build wheels (Linux 3.11)
7973
run: make dist-cibw
8074
shell: bash
8175
env:
8276
CIBW_BUILD: "${{ inputs.kind }}311-*x86_64" # only build x86_64, skip i686
83-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
77+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
8478
if: ${{ runner.os == 'Linux' && inputs.version == '3.11'}}
8579

8680
- name: Build wheels (Linux 3.12)
8781
run: make dist-cibw
8882
shell: bash
8983
env:
9084
CIBW_BUILD: "${{ inputs.kind }}312-*x86_64" # only build x86_64, skip i686
91-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
85+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
9286
if: ${{ runner.os == 'Linux' && inputs.version == '3.12'}}
9387

9488
- name: Build wheels (Mac 3.7)
9589
run: make dist-cibw
9690
shell: bash
9791
env:
9892
CIBW_BUILD: "${{ inputs.kind }}37-*" # build x86_64, arm64, and universal2
99-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
93+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
10094
if: ${{ runner.os == 'macOS' && inputs.version == '3.7'}}
10195

10296
- name: Build wheels (Mac 3.8)
10397
run: make dist-cibw
10498
shell: bash
10599
env:
106100
CIBW_BUILD: "${{ inputs.kind }}38-*" # build x86_64, arm64, and universal2
107-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
101+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
108102
if: ${{ runner.os == 'macOS' && inputs.version == '3.8'}}
109103

110104
- name: Build wheels (Mac 3.9)
111105
run: make dist-cibw
112106
shell: bash
113107
env:
114108
CIBW_BUILD: "${{ inputs.kind }}39-*" # build x86_64, arm64, and universal2
115-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
109+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
116110
if: ${{ runner.os == 'macOS' && inputs.version == '3.9'}}
117111

118112
- name: Build wheels (Mac 3.10)
119113
run: make dist-cibw
120114
shell: bash
121115
env:
122116
CIBW_BUILD: "${{ inputs.kind }}310-*" # build x86_64, arm64, and universal2
123-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
117+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
124118
if: ${{ runner.os == 'macOS' && inputs.version == '3.10'}}
125119

126120
- name: Build wheels (Mac 3.11)
127121
run: make dist-cibw
128122
shell: bash
129123
env:
130124
CIBW_BUILD: "${{ inputs.kind }}311-*" # build x86_64, arm64, and universal2
131-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
125+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
132126
if: ${{ runner.os == 'macOS' && inputs.version == '3.11'}}
133127

134128
- name: Build wheels (Mac 3.12)
135129
run: make dist-cibw
136130
shell: bash
137131
env:
138132
CIBW_BUILD: "${{ inputs.kind }}312-*" # build x86_64, arm64, and universal2
139-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
133+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
140134
if: ${{ runner.os == 'macOS' && inputs.version == '3.12'}}
141135

142136
- name: Build wheels (Windows 3.7)
143137
run: make dist-cibw
144138
shell: bash
145139
env:
146140
CIBW_BUILD: "${{ inputs.kind }}37-*amd64" # build amd64, skip win32 and arm64
147-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
141+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
148142
if: ${{ runner.os == 'Windows' && inputs.version == '3.7'}}
149143

150144
- name: Build wheels (Windows 3.8)
151145
run: make dist-cibw
152146
shell: bash
153147
env:
154148
CIBW_BUILD: "${{ inputs.kind }}38-*amd64" # build amd64, skip win32 and arm64
155-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
149+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
156150
if: ${{ runner.os == 'Windows' && inputs.version == '3.8'}}
157151

158152
- name: Build wheels (Windows 3.9)
159153
run: make dist-cibw
160154
shell: bash
161155
env:
162156
CIBW_BUILD: "${{ inputs.kind }}39-*amd64" # build amd64, skip win32 and arm64
163-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
157+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
164158
if: ${{ runner.os == 'Windows' && inputs.version == '3.9'}}
165159

166160
- name: Build wheels (Windows 3.10)
167161
run: make dist-cibw
168162
shell: bash
169163
env:
170164
CIBW_BUILD: "${{ inputs.kind }}310-*amd64" # build amd64, skip win32 and arm64
171-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
165+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
172166
if: ${{ runner.os == 'Windows' && inputs.version == '3.10'}}
173167

174168
- name: Build wheels (Windows 3.11)
175169
run: make dist-cibw
176170
shell: bash
177171
env:
178172
CIBW_BUILD: "${{ inputs.kind }}311-*amd64" # build amd64, skip win32 and arm64
179-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
173+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
180174
if: ${{ runner.os == 'Windows' && inputs.version == '3.11'}}
181175

182176
- name: Build wheels (Windows 3.12)
183177
run: make dist-cibw
184178
shell: bash
185179
env:
186180
CIBW_BUILD: "${{ inputs.kind }}312-*amd64" # build amd64, skip win32 and arm64
187-
CIBW_TEST_COMMAND: "echo 'Skipping tests, run on separate actions'"
181+
CIBW_TEST_COMMAND: "${{ inputs.test }}"
188182
if: ${{ runner.os == 'Windows' && inputs.version == '3.12'}}

setup-cache/action.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
name: Setup Python Caching
1+
name: Setup Python caching
22
description: 'Setup pip caching'
33

44
runs:
55
using: 'composite'
66
steps:
7-
##########
8-
# Caches #
9-
##########
10-
################
11-
# Pip Cache
127
- name: Setup pip cache
138
uses: actions/cache@v3
149
with:

setup-cibuildwheel-cache/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# setup-cibuildwheel-cache
2+
An action to setup caching for [`cibuildwheel`](https://cibuildwheel.readthedocs.io/en/stable/)
3+
4+
## Usage
5+
6+
The following example yaml code will setup cibuildwheel caching.
7+
8+
```yaml
9+
- name: Setup cibuildwheel caching
10+
uses: actions-ext/python/setup-cibuildwheel-cache@v1
11+
```
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Setup cibuildwheel caching
2+
description: 'Setup cibuildwheel caching'
3+
4+
inputs:
5+
version:
6+
type: choice
7+
description: 'Python Version to use'
8+
options:
9+
- '3.7'
10+
- '3.8'
11+
- '3.9'
12+
- '3.10'
13+
- '3.11'
14+
- '3.12'
15+
default: '3.9'
16+
17+
runs:
18+
using: 'composite'
19+
steps:
20+
- name: Display cibuildwheel cache dir
21+
id: cibuildwheel-cache
22+
run: |
23+
from platformdirs import user_cache_path
24+
import os
25+
26+
with open(os.getenv('GITHUB_OUTPUT'), 'w') as f:
27+
f.write(f"dir={str(user_cache_path(appname='cibuildwheel', appauthor='pypa'))}")
28+
shell: python
29+
30+
- name: Cache cibuildwheel tools
31+
uses: actions/cache@v3
32+
with:
33+
path: ${{ steps.cibuildwheel-cache.outputs.dir }}
34+
key: ${{ runner.os }}-cibuildwheel-${{ inputs.version }}

setup-cibuildwheel/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# setup-cibuildwheel
2+
An action to install and configure caching for [`cibuildwheel`](https://cibuildwheel.readthedocs.io/en/stable/)
3+
4+
## Usage
5+
6+
The following example yaml code will install cibuildwheel and configure caching.
7+
8+
```yaml
9+
- name: Setup cibuildwheel
10+
uses: actions-ext/python/setup-cibuildwheel@v1
11+
with:
12+
version: '3.9'
13+
```

setup-cibuildwheel/action.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Setup cibuildwheel
2+
description: 'Ensure cibuildwheel is installed, and setup caching'
3+
4+
inputs:
5+
version:
6+
type: choice
7+
description: "Python version"
8+
options:
9+
- '3.7'
10+
- '3.8'
11+
- '3.9'
12+
- '3.10'
13+
- '3.11'
14+
default: '3.9'
15+
16+
runs:
17+
using: 'composite'
18+
steps:
19+
- name: Setup cibuildwheel caching
20+
uses: actions-ext/python/setup-cibuildwheel-cache@v1
21+
with:
22+
version: ${{ inputs.version }}
23+
24+
- name: Install cibuildwheel
25+
run: pip install -U cibuildwheel
26+
shell: bash

setup/action.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,20 @@ inputs:
55
version:
66
type: choice
77
description: "Version to install"
8-
options:
9-
- '3.7'
10-
- '3.8'
11-
- '3.9'
12-
- '3.10'
13-
- '3.11'
8+
options:
9+
- '3.7'
10+
- '3.8'
11+
- '3.9'
12+
- '3.10'
13+
- '3.11'
14+
default: '3.9'
1415

1516
runs:
1617
using: 'composite'
1718
steps:
18-
##########
19-
# Caches #
20-
##########
21-
################
2219
- name: Setup Pip caching
2320
uses: actions-ext/python/setup-cache@v1
2421

25-
###############################
26-
# Language and Compiler Setup #
27-
###############################
2822
- name: Set up Python ${{ inputs.version }}
2923
uses: actions/setup-python@v4
3024
with:

upload-dist/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ inputs:
55
kind:
66
type: choice
77
description: "Kind of asset to upload"
8-
options:
9-
- wheel
10-
- sdist
8+
options:
9+
- wheel
10+
- sdist
1111

1212
runs:
1313
using: 'composite'

0 commit comments

Comments
 (0)