Skip to content

ci: fix artifacts upload, add arm build #113

ci: fix artifacts upload, add arm build

ci: fix artifacts upload, add arm build #113

Workflow file for this run

name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
python -m pip install -e .[test]
- name: Run isort check
run: python -m isort codebleu --check
- name: Run black check
run: python -m black codebleu --check
- name: Run ruff check
run: python -m ruff codebleu
- name: Run mypy check
run: python -m mypy codebleu
# First run tests to fail fast, then testing on all python versions and os
fast-tests-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip' # caching pip dependencies
- name: Install lib from source and dependencies
run: |
python -m pip install -e .[test]
- name: Run tests
run: python -m pytest
external-build-workflow:
needs: [fast-tests-python]
uses: ./.github/workflows/reusable-build.yml

Check failure on line 50 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / Test

Invalid workflow file

The workflow is not valid. In .github/workflows/test.yml (Line: 50, Col: 11): Error from called workflow k4black/codebleu/.github/workflows/reusable-build.yml@1813674915b7a0f02a3a3ee892ea114ff810e7b6 (Line: 37, Col: 13): Unrecognized named-value: 'os'. Located at position 1 within expression: os.name == 'Linux'
with:
CIBW_SKIP: "pp* cp36-* cp37-*"
CIBW_BUILD: "cp*-macosx* cp*-manylinux* cp*-win*"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ARCHS_LINUX: "x86_64 i686 aarch64"
CIBW_ARCHS_WINDOWS: "x86_64"
secrets: inherit
full-tests-python:
needs: [fast-tests-python, external-build-workflow]
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, macos-14, windows-latest] # at the moment macos-14 is exclusive M1 chip
fail-fast: false
name: Test wheel on ${{ matrix.os }} and Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
# for macos-14 get macos-latest artifacts
name: wheels-${{ matrix.os == 'macos-14' && 'macos-latest' || matrix.os }}
path: dist
- name: Show dist files
run: ls -lah ./dist
shell: bash
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Remove sdist package to force install wheel later
run: |
rm -rf ./dist/*.tar.gz
shell: bash
- name: Install lib and dependencies
run: |
# force install package from local dist directory
pip uninstall -y codebleu || true
# TODO: check the sdist package is not installed
pip install --upgrade --no-deps --no-index --find-links=./dist codebleu
# install dependencies for the package and tests
pip install .[test]
- name: Test itself
run: python -m pytest --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: coverage.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)