diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b544281a..d5f3be73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-latest", "windows-latest"] + os: ["ubuntu-latest", "ubuntu-24.04-arm", "macos-latest", "windows-latest"] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"] exclude: - os: "macos-latest" @@ -163,47 +163,7 @@ jobs: - name: Run tests with docker if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} run: nox -vs docker_test -- backblazeit/b2:test - test-linux-bundle: - timeout-minutes: 90 - needs: cleanup_buckets - env: - B2_TEST_APPLICATION_KEY: ${{ secrets.B2_TEST_APPLICATION_KEY }} - B2_TEST_APPLICATION_KEY_ID: ${{ secrets.B2_TEST_APPLICATION_KEY_ID }} - runs-on: ubuntu-latest - container: - image: "python:3.12" # can not use ${{ env.PYTHON_DEFAULT_VERSION }} here - env: - DEBIAN_FRONTEND: noninteractive - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install dependencies - run: | - apt-get -y update - apt-get -y install patchelf - python -m pip install --upgrade nox pdm - git config --global --add safe.directory '*' - - name: Bundle the distribution - id: bundle - run: nox -vs bundle - - name: Generate hashes - id: hashes - run: nox -vs make_dist_digest - - name: Run integration tests (without secrets) - run: nox -vs integration -p ${{ env.PYTHON_DEFAULT_VERSION }} -- --sut=${{ steps.bundle.outputs.sut_path }} -m "not require_secrets" - - name: Run integration tests (with secrets) - if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} - run: nox -vs integration -p ${{ env.PYTHON_DEFAULT_VERSION }} -- --sut=${{ steps.bundle.outputs.sut_path }} -m "require_secrets" --cleanup - - name: Upload assets - if: failure() - uses: actions/upload-artifact@v4 - with: - path: ${{ steps.bundle.outputs.asset_path }} - if-no-files-found: warn - retention-days: 7 - overwrite: true - test-windows-bundle: + test-bundle: timeout-minutes: 90 needs: cleanup_buckets env: @@ -213,16 +173,28 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, windows-2025] + os: ["ubuntu-22.04", "ubuntu-22.04-arm", "windows-2022"] # keep the versions aligned with cd.yml steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} + - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} (deadsnakes) + if: startsWith(matrix.os, 'ubuntu') + uses: deadsnakes/action@v3.2.0 # staticx doesn't work with python installed by setup-python action + with: + python-version: ${{ env.PYTHON_DEFAULT_VERSION }} + - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} (setup-python) + if: (!startsWith(matrix.os, 'ubuntu')) uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_DEFAULT_VERSION }} - - name: Install dependencies + - name: Install OS dependencies + if: startsWith(matrix.os, 'ubuntu') + run: | + sudo apt-get -y update + sudo apt-get -y install patchelf + git config --global --add safe.directory '*' + - name: Install python dependencies run: python -m pip install --upgrade nox pdm - name: Bundle the distribution id: bundle diff --git a/changelog.d/1099.infrastructure.md b/changelog.d/1099.infrastructure.md new file mode 100644 index 00000000..1e4858fd --- /dev/null +++ b/changelog.d/1099.infrastructure.md @@ -0,0 +1 @@ +Prepare Linux binary for ARM. diff --git a/noxfile.py b/noxfile.py index 83e2a813..6f6d8cfc 100644 --- a/noxfile.py +++ b/noxfile.py @@ -68,6 +68,7 @@ def _detect_python_nox_id() -> str: DOCKER_TEMPLATE = pathlib.Path('docker/Dockerfile.template') SYSTEM = platform.system().lower() +MACHINE = platform.machine().lower() WINDOWS_TIMESTAMP_SERVER = 'http://timestamp.digicert.com' WINDOWS_SIGNTOOL_PATH = 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' @@ -328,7 +329,7 @@ def bundle(session: nox.Session): session.run('pyinstaller', *session.posargs, f'{binary_name}.spec') - if SYSTEM == 'linux' and not NO_STATICX: + if SYSTEM == 'linux' and MACHINE == "x86_64" and not NO_STATICX: session.run( 'staticx', '--no-compress', diff --git a/pdm.lock b/pdm.lock index 8af56656..4e11c99c 100644 --- a/pdm.lock +++ b/pdm.lock @@ -3,9 +3,9 @@ [metadata] groups = ["default", "bundle", "doc", "format", "full", "license", "lint", "release", "test"] -strategy = ["cross_platform", "inherit_metadata"] +strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:7e59c9b087e928b53e5556d69583d7565ba54d4a742d9dfd81a4bf51cd68e1f0" +content_hash = "sha256:d73337b9d14f3967a6f14081f4f6e719ae99af6ac240ce8d9d644cc66879a7ba" [[metadata.targets]] requires_python = ">=3.9" @@ -1204,7 +1204,7 @@ name = "pyelftools" version = "0.32" summary = "Library for analyzing ELF files and DWARF debugging information" groups = ["bundle"] -marker = "platform_system == \"Linux\"" +marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" files = [ {file = "pyelftools-0.32-py3-none-any.whl", hash = "sha256:013df952a006db5e138b1edf6d8a68ecc50630adbd0d83a2d41e7f846163d738"}, {file = "pyelftools-0.32.tar.gz", hash = "sha256:6de90ee7b8263e740c8715a925382d4099b354f29ac48ea40d840cf7aa14ace5"}, @@ -1776,7 +1776,7 @@ version = "0.13.9" requires_python = ">=3.5" summary = "Build static self-extracting app from dynamic executable" groups = ["bundle"] -marker = "platform_system == \"Linux\"" +marker = "platform_system == \"Linux\" and platform_machine == \"x86_64\"" dependencies = [ "pyelftools", ] diff --git a/pyproject.toml b/pyproject.toml index 007f76ca..e49a1542 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -221,5 +221,5 @@ bundle = [ "pyinstaller<6,>=5.13; python_version < \"3.13\"", "pyinstaller-hooks-contrib>=2023.6", "patchelf-wrapper==1.2.0; platform_system == \"Linux\"", - "staticx~=0.13.9; platform_system == \"Linux\"", + "staticx~=0.13.9; platform_system == \"Linux\" and platform_machine == \"x86_64\"", ]