1111 branches :
1212 - ' **'
1313
14+ # Allow one concurrent deployment
15+ concurrency :
16+ group : ${{ github.ref }}-test
17+ cancel-in-progress : true
18+
1419jobs :
1520 test :
1621 name : Build and Test
1722
1823 strategy :
1924 matrix :
20- python : ["3.7", "3.8", "3.9", "3.10"]
25+ python : ["3.7", "3.8", "3.9", "3.10", "3.11" ]
2126 target :
2227 - id : ' linux-amd64'
23- os : ' ubuntu-18.04 '
28+ os : ' ubuntu-latest '
2429 target-name : ' x86_64-unknown-linux-gnu'
2530 rust-toolchain : ' stable'
2631 llvm_url : ' https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz'
4348 rust-toolchain : ' stable'
4449 # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/11.x/windows-amd64.tar.gz'
4550 llvm_choco_version : 13.0.0
46- fail-fast : true
51+ fail-fast : false
4752
4853 runs-on : ${{ matrix.target.os }}
4954
6772 target : ${{ matrix.target.target-name }}
6873
6974 # Caching is disabled because it interferes with artifact creation
70- # - uses: Swatinem/rust-cache@v1
75+ # - uses: Swatinem/rust-cache@v2
76+ # with:
77+ # shared-key: "rust-cache"
7178
7279 - name : Set current Python version
7380 shell : bash
7683
7784 - name : Set up Python ${{ matrix.python }} (amd64)
7885 if : matrix.target.id != 'linux-aarch64'
79- uses : actions/setup-python@v1
86+ uses : actions/setup-python@v4
8087 with :
8188 python-version : ${{ matrix.python }}
89+ architecture : x64
8290
8391 - name : Set up Python ${{ matrix.python }} (aarch64)
8492 if : matrix.target.id == 'linux-aarch64'
9199 pyenv install --list | grep '^ ${{ matrix.python }}' | tail -n 1 | tr -d '[:space:]' > .python-version
92100 pyenv install --skip-existing "$(cat .python-version)"
93101
102+ - name : Validate python version
103+ run : |
104+ $pythonVersionFull = (python --version)
105+ $pythonVersion = $pythonVersionFull -replace '\.(\d+)$',''
106+ if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){
107+ Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
108+ exit 1
109+ }
110+ $pythonVersion
111+ shell : pwsh
112+ - name : Print python version (verbose)
113+ run : |
114+ python -VV
115+ shell : pwsh
116+
94117 - name : Install LLVM (Choco - Windows)
95118 if : matrix.target.llvm_choco_version
96119 shell : bash
@@ -99,10 +122,7 @@ jobs:
99122 cd 'C:\Program Files\LLVM\'
100123 LLVM_DIR=$(pwd)
101124 echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV
102- - name : Install LLVM (macOS Apple Silicon)
103- if : matrix.target.os == 'macos-latest' && !matrix.target.llvm_url
104- run : |
105- brew install llvm
125+
106126 - name : Install LLVM
107127 if : matrix.target.llvm_url
108128 shell : bash
@@ -143,14 +163,15 @@ jobs:
143163 export PATH="$HOME/.pyenv/versions/$(cat .python-version)/bin:$PATH"
144164 just prelude
145165
166+
146167 - name : Compile the library
147168 shell : bash
148169 run : |
149170 export PATH="$HOME/.cargo/bin:$PATH"
150171 export PATH="$HOME/.pyenv/versions/$(cat .python-version)/bin:$PATH"
151172 if test -d .env/bin/; then source .env/bin/activate; else source .env/Scripts/activate; fi
152173 maturin list-python
153- PYTHON_INTERPRETER=$(maturin list-python | grep -o "CPython $(cat .python-version | grep -o -E '^[^\.]+\.[^\.]+').* at .*" | cut -d' ' -f 4 | tr '\\' '/')
174+ PYTHON_INTERPRETER=$(maturin list-python 2>&1 | grep -o "CPython $(cat .python-version | grep -o -E '^[^\.]+\.[^\.]+').* at .*" | cut -d' ' -f 4 | tr '\\' '/')
154175 echo "Selected interpreter: ${PYTHON_INTERPRETER}"
155176 just build-all "${{ matrix.target.target-name }}"
156177
@@ -169,7 +190,7 @@ jobs:
169190 export PATH="$HOME/.pyenv/versions/$(cat .python-version)/bin:$PATH"
170191 if test -d .env/bin/; then source .env/bin/activate; else source .env/Scripts/activate; fi
171192 maturin list-python
172- PYTHON_INTERPRETER=$(maturin list-python | grep -o "CPython $(cat .python-version | grep -o -E '^[^\.]+\.[^\.]+').* at .*" | cut -d' ' -f 4 | tr '\\' '/')
193+ PYTHON_INTERPRETER=$(maturin list-python 2>&1 | grep -o "CPython $(cat .python-version | grep -o -E '^[^\.]+\.[^\.]+').* at .*" | cut -d' ' -f 4 | tr '\\' '/')
173194 echo "Selected interpreter: ${PYTHON_INTERPRETER}"
174195 just build-all-wheels "${PYTHON_INTERPRETER}" "${{ matrix.target.target-name }}"
175196 just build-any-wheel
@@ -190,7 +211,7 @@ jobs:
190211 prerelease :
191212 name : Pre-Release
192213
193- runs-on : ubuntu-18.04
214+ runs-on : ubuntu-latest
194215 if : startsWith(github.ref, 'refs/heads/prepare-')
195216
196217 needs : [test]
@@ -212,13 +233,13 @@ jobs:
212233 - name : Set current Python version
213234 shell : bash
214235 run : |
215- echo "3.9 " > .python-version
236+ echo "3.11 " > .python-version
216237
217238 - name : Set up Python ${{ matrix.python }} (amd64)
218239 if : matrix.target.id != 'linux-aarch64'
219- uses : actions/setup-python@v1
240+ uses : actions/setup-python@v4
220241 with :
221- python-version : 3.9
242+ python-version : 3.11
222243
223244 - name : Set up Python ${{ matrix.python }} (aarch64)
224245 if : matrix.target.id == 'linux-aarch64'
@@ -228,7 +249,7 @@ jobs:
228249 export PATH="$HOME/.pyenv/bin:$PATH"
229250 eval "$(pyenv init -)"
230251 eval "$(pyenv virtualenv-init -)"
231- pyenv install --list | grep '^ 3.9 ' | tail -n 1 | tr -d '[:space:]' > .python-version
252+ pyenv install --list | grep '^ 3.11 ' | tail -n 1 | tr -d '[:space:]' > .python-version
232253 pyenv install --skip-existing "$(cat .python-version)"
233254
234255 # Caching is disabled because it interferes with artifact creation
0 commit comments