Skip to content

Commit

Permalink
ci: fix artifacts upload, add arm build (#26)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
k4black authored Feb 2, 2024
1 parent 297e074 commit 1122983
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected].4
uses: pypa/[email protected].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:
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,32 @@ 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:
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, 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 }}
steps:
- 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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down

0 comments on commit 1122983

Please sign in to comment.