remove support to python3.7 #40
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | ||
on: | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "release/*" | ||
- "deps/*" | ||
paths-ignore: | ||
- "LICENSE" | ||
- "SECURITY.md" | ||
- "README.md" | ||
- "makefile" | ||
- ".gitingore" | ||
#- ".github/workflows/*" | ||
push: | ||
branches: | ||
- "main" | ||
- "release/*" | ||
- "deps/*" | ||
paths-ignore: | ||
- "LICENSE" | ||
- "SECURITY.md" | ||
- "README.md" | ||
- "makefile" | ||
- ".gitingore" | ||
#- ".github/workflows/*" | ||
env: | ||
PKG_CONFIG_ALLOW_CROSS: 1 | ||
PY_SQLX_VERSION: 0.0.1 # change when the run "release - check package version" | ||
PYTHON_VERSIONS: "3.8 3.9 3.10 3.11 3.12" | ||
jobs: | ||
rust-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: cache-rust | ||
name: cache rust | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: v3 | ||
- name: install rust stable | ||
id: rust-toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: llvm-tools | ||
- name: run test | ||
run: cargo test -p database -p convert -p py_types | ||
build-sdist: | ||
name: build sdist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: pip install -U toml httpx | ||
- name: production - check package version | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
python .github/prod.py | ||
- name: release - check package version | ||
if: contains(github.ref, 'release') | ||
run: | | ||
python .github/release.py | ||
- uses: PyO3/maturin-action@v1 | ||
with: | ||
command: sdist | ||
args: --out dist | ||
rust-toolchain: stable | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: pypi_files | ||
path: dist | ||
build: | ||
name: build on ${{ matrix.platform || matrix.os }} (${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }}) | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu, macos, windows] | ||
target: [x86_64, aarch64] | ||
manylinux: [auto] | ||
include: | ||
- os: ubuntu | ||
platform: linux | ||
- os: windows | ||
ls: dir | ||
interpreter: ${{ env.PYTHON_VERSIONS }} | ||
Check failure on line 98 in .github/workflows/ci.yaml GitHub Actions / ciInvalid workflow file
|
||
- os: windows | ||
ls: dir | ||
target: i686 | ||
python-architecture: x86 | ||
interpreter: ${{ env.PYTHON_VERSIONS }} | ||
# depends from libz, not working on windows correctly. | ||
#- os: windows | ||
# ls: dir | ||
# target: aarch64 | ||
# interpreter: 3.11 3.12 | ||
- os: macos | ||
target: aarch64 | ||
interpreter: ${{ env.PYTHON_VERSIONS }} | ||
- os: ubuntu | ||
platform: linux | ||
target: i686 | ||
- os: ubuntu | ||
platform: linux | ||
target: aarch64 | ||
- os: ubuntu | ||
platform: linux | ||
target: armv7 | ||
interpreter: ${{ env.PYTHON_VERSIONS }} | ||
# musllinux | ||
- os: ubuntu | ||
platform: linux | ||
target: x86_64 | ||
manylinux: musllinux_1_1 | ||
- os: ubuntu | ||
platform: linux | ||
target: aarch64 | ||
manylinux: musllinux_1_1 | ||
- os: ubuntu | ||
platform: linux | ||
target: ppc64le | ||
interpreter: ${{ env.PYTHON_VERSIONS }} | ||
- os: ubuntu | ||
platform: linux | ||
target: s390x | ||
interpreter: ${{ env.PYTHON_VERSIONS }} | ||
exclude: | ||
# Optimized PGO builds for x86_64 manylinux and windows follow a different matrix, | ||
# maybe in future maturin-action can support this automatically | ||
- os: ubuntu | ||
target: x86_64 | ||
manylinux: auto | ||
- os: windows | ||
target: x86_64 | ||
# Windows on arm64 only supports Python 3.11+ | ||
- os: windows | ||
target: aarch64 | ||
runs-on: ${{ matrix.os }}-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
architecture: ${{ matrix.python-architecture || 'x64' }} | ||
- run: pip install -U toml httpx twine | ||
- name: production - check package version | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
python .github/prod.py | ||
- name: release - check package version | ||
if: contains(github.ref, 'release') | ||
run: | | ||
python .github/release.py | ||
- name: build wheel | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
manylinux: ${{ matrix.manylinux || 'auto' }} | ||
args: > | ||
--release | ||
--out dist | ||
--interpreter ${{ matrix.interpreter || '3.8 3.9 3.10 3.11 3.12' }} ${{ matrix.extra-build-args }} | ||
rust-toolchain: stable | ||
sccache: true | ||
docker-options: -e CI | ||
- run: ${{ matrix.ls || 'ls -lh' }} dist/ | ||
- run: twine check --strict dist/* | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: pypi_files | ||
path: dist | ||
build-pgo: | ||
name: build pgo-optimized on ${{ matrix.platform || matrix.os }} (${{ matrix.interpreter}} - ${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }}) | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu, windows] | ||
target: [x86_64] | ||
manylinux: [auto] | ||
interpreter: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
include: | ||
- os: ubuntu | ||
platform: linux | ||
- os: windows | ||
ls: dir | ||
runs-on: ${{ matrix.os }}-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.interpreter }} | ||
architecture: ${{ matrix.python-architecture || 'x64' }} | ||
- name: install rust stable | ||
id: rust-toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: llvm-tools | ||
- run: pip install -U toml httpx twine | ||
- name: production - check package version | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
python .github/prod.py | ||
- name: release - check package version | ||
if: contains(github.ref, 'release') | ||
run: | | ||
python .github/release.py | ||
- name: build pgo-optimized wheel | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
manylinux: ${{ matrix.manylinux || 'auto' }} | ||
args: > | ||
--release | ||
--out dist | ||
--interpreter ${{ matrix.maturin-interpreter || matrix.interpreter }} | ||
rust-toolchain: stable | ||
sccache: true | ||
docker-options: -e CI | ||
- run: ${{ matrix.ls || 'ls -lh' }} dist/ | ||
- run: twine check --strict dist/* | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: pypi_files | ||
path: dist | ||
release: | ||
name: Release | ||
if: contains(github.ref, 'main') || contains(github.ref, 'release') && !cancelled() && success() | ||
needs: [rust-test, build-sdist, build, build-pgo] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: install deps | ||
run: pip install -U twine toml httpx | ||
- name: production - check package version | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
python .github/prod.py | ||
- name: release - check package version | ||
if: contains(github.ref, 'release') | ||
run: | | ||
python .github/release.py | ||
- name: download articart | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: pypi_files | ||
path: dist | ||
- run: twine check --strict dist/* | ||
- name: upload to pypi | ||
run: twine upload dist/* --verbose | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
- name: create release | ||
if: github.ref == 'refs/heads/main' | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.PY_SQLX_VERSION }} | ||
release_name: ${{ env.PY_SQLX_VERSION }} | ||
body: | | ||
Changes in this Release | ||
${{ github.event.head_commit.message }} | ||
draft: false | ||
prerelease: false |