From a3164a03c81cad0d3f88d4789323a1516ee4ff87 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 3 Oct 2021 16:58:24 +0200 Subject: [PATCH] Enable GitHub Actions (#23) --- .github/workflows/wheels.yml | 28 ++++++++++++++++++++++++ .travis.yml | 41 ------------------------------------ tests/cbc/test_cbc.py | 2 +- tests/ctr/test_ctr.py | 2 +- tests/ige/test_ige.py | 2 +- 5 files changed, 31 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/wheels.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..2debfc1 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,28 @@ +name: Build wheels + +on: [push] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: actions/checkout@v2 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.2.0a1 + env: + CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" + CIBW_TEST_REQUIRES: tox + CIBW_TEST_COMMAND: cd {project} && tox + CIBW_TEST_SKIP: "*-win*" + CIBW_BUILD_VERBOSITY: 1 + + - name: Store wheels + uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7d90c81..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: python - -jobs: - include: - # Perform a Linux i686 and x86_64 build - - services: docker - - # Perform a Linux AArch64 build - - services: docker - arch: arm64 - - # Perform a macOS x86_64 build - - os: osx - # PyPy 7.3.2 needs macOS >= 10.14 - osx_image: xcode10.2 - language: shell - - # Perform a Windows 32-bit and 64-bit build - - os: windows - language: shell - before_install: - - choco install python --version 3.8.0 - - export PATH="/c/Python38:/c/Python38/Scripts:$PATH" - # Make sure Python is on PATH as "python3" - - ln -s /c/Python38/python.exe /c/Python38/python3.exe - -env: - global: - - CIBW_BUILD="cp36-* cp37-* cp38-* cp39-*" - - CIBW_BUILD_VERBOSITY=3 - - CIBW_BEFORE_BUILD="pip install tox" - - CIBW_TEST_COMMAND="cd {project} && tox" - - BUILD_OUTPUT_PATH="$(uname | perl -ne 'print lc')-tgcrypto-wheels" - -install: - - python3 -m pip install cibuildwheel - -script: - - cibuildwheel --output-dir $BUILD_OUTPUT_PATH - - tar zcf $BUILD_OUTPUT_PATH.tar.gz $BUILD_OUTPUT_PATH - - echo $(curl -sF "file=@$BUILD_OUTPUT_PATH.tar.gz" https://file.io) diff --git a/tests/cbc/test_cbc.py b/tests/cbc/test_cbc.py index ebf2001..ad7c43e 100644 --- a/tests/cbc/test_cbc.py +++ b/tests/cbc/test_cbc.py @@ -133,7 +133,7 @@ def test_cbc256_{mode}_{name}_{count}(self): class TestCBC256Input(unittest.TestCase): - TYPE_ERROR_PATTERN = r"'\w+' does not support the buffer interface|a bytes-like object is required, not '\w+'" + TYPE_ERROR_PATTERN = r"'\w+' does not (support|have) the buffer interface|a bytes-like object is required, not '\w+'" def test_cbc256_encrypt_invalid_args_count(self): with self.assertRaisesRegex(TypeError, r"function takes exactly \d arguments \(\d given\)"): diff --git a/tests/ctr/test_ctr.py b/tests/ctr/test_ctr.py index 8f26260..e59f88a 100644 --- a/tests/ctr/test_ctr.py +++ b/tests/ctr/test_ctr.py @@ -108,7 +108,7 @@ def test_ctr256_encrypt_extra3(self): class TestCTR256Input(unittest.TestCase): - TYPE_ERROR_PATTERN = r"'\w+' does not support the buffer interface|a bytes-like object is required, not '\w+'" + TYPE_ERROR_PATTERN = r"'\w+' does not (support|have) the buffer interface|a bytes-like object is required, not '\w+'" def test_ctr256_encrypt_invalid_args_count(self): with self.assertRaisesRegex(TypeError, r"function takes exactly \d arguments \(\d given\)"): diff --git a/tests/ige/test_ige.py b/tests/ige/test_ige.py index 7995031..208eb5f 100644 --- a/tests/ige/test_ige.py +++ b/tests/ige/test_ige.py @@ -24,7 +24,7 @@ class TestIGE256Input(unittest.TestCase): - TYPE_ERROR_PATTERN = r"'\w+' does not support the buffer interface|a bytes-like object is required, not '\w+'" + TYPE_ERROR_PATTERN = r"'\w+' does not (support|have) the buffer interface|a bytes-like object is required, not '\w+'" def test_ige256_encrypt_invalid_args_count(self): with self.assertRaisesRegex(TypeError, r"function takes exactly \d arguments \(\d given\)"):