Skip to content

[pre-commit.ci] pre-commit autoupdate #144

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #144

Workflow file for this run

name: CI
on:
push:
branches: [main]
tags: [v*]
pull_request:
workflow_dispatch:
env:
ICU_DL_PATH: "https://github.com/unicode-org/icu/releases/download/release-71-1"
ICU4C_UBUNTU_TGZ: "icu4c-71_1-Ubuntu20.04-x64.tgz"
ICU4C_WIN64_ZIP: "icu4c-71_1-Win64-MSVC2019.zip"
jobs:
test:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- run: mkdir -p build
- name: Set up requirements (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
working-directory: build
run: |
curl -LO ${{env.ICU_DL_PATH}}/${{env.ICU4C_UBUNTU_TGZ}}
sudo tar zxf ${{env.ICU4C_UBUNTU_TGZ}} -C / --strip-components=2
echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/lib" >> $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 ${{env.ICU_DL_PATH}}/${{env.ICU4C_WIN64_ZIP}}
7z x ${{env.ICU4C_WIN64_ZIP}} -o${{env.ICU4C_DIR}}
echo "ICU_ROOT=${{env.INSTALL_PREFIX}}/${{env.ICU4C_DIR}}" >> $env:GITHUB_ENV
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
cache: "poetry"
- name: Install dependencies
run: |
poetry install
- name: Run tests and collect coverage data
continue-on-error: true
run: |
poetry run coverage run -p -m pytest
- name: Store coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-data
path: ".coverage.*"
if-no-files-found: error
report:
needs: test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
pipx install coverage[toml]
- name: Restore coverage data
uses: actions/download-artifact@v3
with:
name: coverage-data
- name: Report coverage statistics
run: |
coverage combine
coverage report -m
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3