1
1
name : Continuous Integration
2
- on : # rebuild any PRs and main branch changes
2
+ on :
3
3
pull_request :
4
4
push :
5
5
branches :
@@ -12,15 +12,16 @@ jobs:
12
12
strategy :
13
13
fail-fast : true
14
14
matrix :
15
- # TODO(cretz): 3.10.8 is breaking Windows Rust build
16
- python : ["3.7", "3.10.7"]
17
- os : [ubuntu-latest, macos-latest, windows-latest]
15
+ python : ["3.7", "3.11"]
16
+ os : [ubuntu-latest, macos-latest, windows-latest, ubuntu-arm]
18
17
include :
19
18
- os : ubuntu-latest
20
- python : 3.10.7
19
+ python : " 3.11 "
21
20
docsTarget : true
22
21
protoCheckTarget : true
23
- runs-on : ${{ matrix.os }}
22
+ - os : ubuntu-arm
23
+ runsOn : buildjet-4vcpu-ubuntu-2204-arm
24
+ runs-on : ${{ matrix.runsOn || matrix.os }}
24
25
steps :
25
26
- name : Print build information
26
27
run : " echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}, os: ${{ matrix.os }}, python: ${{ matrix.python }}"
@@ -33,15 +34,23 @@ jobs:
33
34
- uses : Swatinem/rust-cache@v1
34
35
with :
35
36
working-directory : temporalio/bridge
36
- - uses : actions/setup-python@v4
37
+ # actions/setup-python doesn't yet support ARM
38
+ - if : ${{ !endsWith(matrix.os, '-arm') }}
39
+ uses : actions/setup-python@v4
40
+ with :
41
+ python-version : ${{ matrix.python }}
42
+ - if : ${{ matrix.os == 'ubuntu-arm' }}
43
+ uses :
deadsnakes/[email protected]
37
44
with :
38
45
python-version : ${{ matrix.python }}
39
46
- run : python -m pip install --upgrade wheel poetry poethepoet
40
47
- run : poetry install --no-root -E opentelemetry
41
48
- run : poe lint
42
49
- run : poe build-develop
43
50
- run : poe test -s -o log_cli_level=DEBUG
44
- - run : poe test -s -o log_cli_level=DEBUG --workflow-environment time-skipping
51
+ # Time skipping doesn't yet support ARM
52
+ - if : ${{ !endsWith(matrix.os, '-arm') }}
53
+ run : poe test -s -o log_cli_level=DEBUG --workflow-environment time-skipping
45
54
46
55
# Confirm protos are already generated properly
47
56
- name : Check generated protos
@@ -58,103 +67,3 @@ jobs:
58
67
- name : Deploy prod API docs
59
68
if : ${{ github.ref == 'refs/heads/main' && matrix.docsTarget }}
60
69
run : npx vercel deploy build/apidocs -t ${{ secrets.VERCEL_TOKEN }} --name python --scope temporal --prod --yes
61
-
62
- # Compile the binaries and upload artifacts
63
- compile-binaries :
64
- strategy :
65
- fail-fast : true
66
- matrix :
67
- include :
68
- - os : ubuntu-latest
69
- package-suffix : linux-amd64
70
- ci-arch : auto
71
- - os : macos-latest
72
- package-suffix : macos-amd64
73
- ci-arch : auto
74
- # TODO(cretz): Disabling macOS arm because cibuildwheel is still
75
- # generating an x64 wheel name even for arm64
76
- # - os: macos-latest
77
- # package-suffix: macos-arm64
78
- # ci-arch: arm64
79
- rust-add-target : aarch64-apple-darwin
80
- - os : windows-latest
81
- package-suffix : windows-amd64
82
- ci-arch : auto
83
- runs-on : ${{ matrix.os }}
84
- steps :
85
- - uses : actions/checkout@v2
86
- with :
87
- submodules : recursive
88
- - uses : actions/setup-python@v4
89
- with :
90
- python-version : " 3.10.7"
91
-
92
- # Install Rust locally for non-Linux (Linux uses an internal docker
93
- # command to build with cibuildwheel which uses rustup install defined
94
- # in pyproject.toml)
95
- - if : ${{ runner.os != 'Linux' }}
96
- uses : actions-rs/toolchain@v1
97
- with :
98
- toolchain : stable
99
- target : ${{ matrix.rust-add-target }}
100
- - if : ${{ runner.os != 'Linux' }}
101
- uses : Swatinem/rust-cache@v1
102
- with :
103
- working-directory : temporalio/bridge
104
-
105
- # Prepare
106
- - run : python -m pip install --upgrade wheel poetry poethepoet
107
- - run : poetry install --no-root -E opentelemetry
108
-
109
- # Add the source dist only for Linux x64 for now
110
- - if : ${{ matrix.package-suffix == 'linux-amd64' }}
111
- run : poetry build --format sdist
112
-
113
- # Build and fix the wheel
114
- - run : poetry run cibuildwheel --output-dir dist --arch ${{ matrix.ci-arch }}
115
- - run : poe fix-wheel
116
-
117
- # Do test only for ci-arch auto (i.e. local machine)
118
- - if : ${{ matrix.ci-arch == 'auto' }}
119
- run : poe test-dist-single
120
-
121
- # Upload dist
122
- - uses : actions/upload-artifact@v2
123
- with :
124
- name : packages-${{ matrix.package-suffix }}
125
- path : dist
126
-
127
- # We separate out Linux aarch64 so we can choose not to run it during PR since
128
- # it is so slow in cibuildwheel (uses QEMU emulation). We can put this back in
129
- # the above matrix when Linux ARM runners are available.
130
- compile-binaries-linux-aarch64 :
131
- # Skip compiling Linux aarch64 on PR
132
- if : ${{ github.event_name != 'pull_request' }}
133
- runs-on : ubuntu-latest
134
- steps :
135
- - uses : actions/checkout@v2
136
- with :
137
- submodules : recursive
138
- - uses : actions/setup-python@v4
139
- with :
140
- python-version : " 3.10.7"
141
-
142
- # Need QEMU for ARM build on Linux
143
- - uses : docker/setup-qemu-action@v1
144
- with :
145
- image : tonistiigi/binfmt:latest
146
- platforms : arm64
147
-
148
- # Prepare
149
- - run : python -m pip install --upgrade wheel poetry poethepoet
150
- - run : poetry install --no-root -E opentelemetry
151
-
152
- # Build and fix the wheel
153
- - run : poetry run cibuildwheel --output-dir dist --arch aarch64
154
- - run : poe fix-wheel
155
-
156
- # Upload dist
157
- - uses : actions/upload-artifact@v2
158
- with :
159
- name : packages-linux-aarch64
160
- path : dist
0 commit comments