[pre-commit.ci] pre-commit autoupdate (#57) #52
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: build wheels | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{matrix.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Set up Python ${{matrix.python-version}} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{matrix.python-version}} | |
- name: Upgrade pip | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade setuptools | |
- name: Install dependencies | |
run: | | |
python -m pip install build pytest | |
- run: mkdir -p build | |
- name: Parse icu-versions.json | |
id: icu | |
shell: bash | |
run: | | |
latest=`cat ./icu-versions.json | jq -r .latest` | |
echo "latest=$latest" | |
content=`cat ./icu-versions.json | jq -c ".versions[] | select(.version == \"$latest\")"` | |
echo "icu4c=$content" | |
echo "icu4c_latest_version=$latest" >> $GITHUB_ENV | |
echo "icu4c_target_json=$content" >> $GITHUB_ENV | |
- name: Set up requirements (Ubuntu) | |
if: startsWith(matrix.os, 'ubuntu') | |
working-directory: build | |
run: | | |
curl -LO ${{fromJson(env.icu4c_target_json).url}}/${{fromJson(env.icu4c_target_json).icu4c_ubuntu_x64_tgz}} | |
sudo tar zxf ${{fromJson(env.icu4c_target_json).icu4c_ubuntu_x64_tgz}} -C / --strip-components=2 | |
echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV | |
echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV | |
- name: Set up requirements (Windows) | |
if: startsWith(matrix.os, 'windows') | |
working-directory: build | |
env: | |
INSTALL_PREFIX: "${{github.workspace}}/build" | |
ICU4C_DIR: "icu4c" | |
run: | | |
curl -LO ${{fromJson(env.icu4c_target_json).url}}/${{fromJson(env.icu4c_target_json).icu4c_win64_zip}} | |
7z x ${{fromJson(env.icu4c_target_json).icu4c_win64_zip}} -o${{env.ICU4C_DIR}} | |
if ("x${{fromJson(env.icu4c_target_json).double_zipped_filename}}" -ne "x") { | |
7z x ${{env.ICU4C_DIR}}/${{fromJson(env.icu4c_target_json).double_zipped_filename}} -o${{env.ICU4C_DIR}} | |
} | |
echo "ICU_ROOT=${{env.INSTALL_PREFIX}}/${{env.ICU4C_DIR}}" >> $env:GITHUB_ENV | |
- name: Build wheel | |
run: | | |
pyproject-build --wheel | |
- name: Store wheel | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist-icupy-icu${{env.icu4c_latest_version}} | |
path: dist/*.whl | |
- name: Run tests | |
run: | | |
python -m pip install --no-deps --no-index --find-links=./dist/ --force-reinstall icupy | |
pytest |