From 1122983b873ffd7afee5f432a785e83c068caa1d Mon Sep 17 00:00:00 2001 From: Konstantin Chernyshev <38007247+k4black@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:54:30 +0100 Subject: [PATCH] ci: fix artifacts upload, add arm build (#26) * ci: try to fix artifacts upload * ci: no ls on windows * ci: add macos-14 (m1) tests * ci: fix shell for ls command * ci: test macos-14 on macos-latest wheels * ci: test macos-14 on macos-latest wheels * ci: add archs building with QEMU * ci: fix QEMU to run on linux only * ci: fix QEMU to run on linux only * ci: fix build platforms list * ci: remove i686 * ci: skip macos-14 with 3.8 and 3.9 --- .github/workflows/publish.yml | 3 +++ .github/workflows/reusable-build.yml | 23 ++++++++++++++++++++++- .github/workflows/test.yml | 14 ++++++++++++-- README.md | 2 +- 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8bfdef0..f933a52 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -52,6 +52,9 @@ jobs: 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 aarch64" + CIBW_ARCHS_WINDOWS: "x86" VERSION: ${{ github.ref_name }} secrets: inherit diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 4026e7f..a28e9a3 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -9,6 +9,15 @@ on: CIBW_BUILD: required: true type: string + CIBW_ARCHS_MACOS: + required: false + type: string + CIBW_ARCHS_LINUX: + required: false + type: string + CIBW_ARCHS_WINDOWS: + required: false + type: string VERSION: required: false type: string @@ -23,18 +32,30 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: Set up QEMU + if: ${{ matrix.os == 'ubuntu-latest' }} + uses: docker/setup-qemu-action@v3 + with: + platforms: all - name: Set correct version if: ${{ inputs.VERSION != '' }} run: echo -n "${{ inputs.VERSION }}" > VERSION - name: Build wheels - uses: pypa/cibuildwheel@v2.16.4 + uses: pypa/cibuildwheel@v2.16.5 with: output-dir: wheelhouse env: CIBW_SKIP: ${{ inputs.CIBW_SKIP }} CIBW_BUILD: ${{ inputs.CIBW_BUILD }} + CIBW_ARCHS_MACOS: ${{ inputs.CIBW_ARCHS_MACOS }} + CIBW_ARCHS_LINUX: ${{ inputs.CIBW_ARCHS_LINUX }} + CIBW_ARCHS_WINDOWS: ${{ inputs.CIBW_ARCHS_WINDOWS }} + - name: List wheels + run: ls -lah ./wheelhouse + shell: bash - uses: actions/upload-artifact@v4 with: + name: wheels-${{ matrix.os }} path: ./wheelhouse/*.whl build-sdist: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 729deff..c524e5c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,6 +51,9 @@ jobs: 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 aarch64" + CIBW_ARCHS_WINDOWS: "x86" secrets: inherit full-tests-python: @@ -58,7 +61,13 @@ jobs: strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, macos-14, windows-latest] # at the moment macos-14 is exclusive M1 chip + # macos-14 not supporting 3.8 and 3.9 + exclude: + - python-version: 3.8 + os: macos-14 + - python-version: 3.9 + os: macos-14 fail-fast: false name: Test wheel on ${{ matrix.os }} and Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} @@ -66,7 +75,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: - name: artifact # if `name: artifact` is omitted, the action will create extra parent dir + # 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 diff --git a/README.md b/README.md index 6f34700..9106a96 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![PyPI version](https://badge.fury.io/py/codebleu.svg)](https://badge.fury.io/py/codebleu) -This repository contains an unofficial `CodeBLEU` implementation that supports `Linux`, `MacOS` and `Windows`. It is available through `PyPI` and the `evaluate` library. +This repository contains an unofficial `CodeBLEU` implementation that supports `Linux`, `MacOS` (incl. M-series) and `Windows`. It is available through `PyPI` and the `evaluate` library. Available for: `Python`, `C`, `C#`, `C++`, `Java`, `JavaScript`, `PHP`, `Go`, `Ruby`.