Jelmer Vernooij 5 месяцев назад
Родитель
Сommit
89941d133e
3 измененных файлов с 74 добавлено и 19 удалено
  1. 51 0
      .github/workflows/android-test.yml
  2. 23 0
      .github/workflows/python-distributions.yml
  3. 0 19
      dulwich/stdint.h

+ 51 - 0
.github/workflows/android-test.yml

@@ -0,0 +1,51 @@
+name: Android tests
+
+on:
+  push:
+    branches: [ main, master ]
+  pull_request:
+
+jobs:
+  test-android:
+    runs-on: ubuntu-latest
+    
+    steps:
+      - uses: actions/checkout@v4
+      
+      - name: Set up Python 3.11
+        uses: actions/setup-python@v5
+        with:
+          python-version: "3.11"
+          cache: pip
+
+      - name: Install native dependencies
+        run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev
+
+      - name: Provide gpgme-config and gpg-error-config
+        run: |
+          mkdir -p "$HOME/.local/bin"
+          cp .github/gpgme-config "$HOME/.local/bin/gpgme-config"
+          cp .github/gpg-error-config "$HOME/.local/bin/gpg-error-config"
+          echo "$HOME/.local/bin" >> $GITHUB_PATH
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade "setuptools>=77"
+          python -m pip install --upgrade pip
+          pip install --upgrade ".[merge,fastimport,paramiko,https]" setuptools-rust
+
+      - name: Install gpg
+        run: pip install --upgrade ".[pgp]"
+
+      - name: Build
+        run: python setup.py build_ext -i
+        env:
+          RUSTFLAGS: "-D warnings"
+
+      - name: Run tests on Android Emulator
+        uses: ReactiveCircus/android-emulator-runner@v2
+        with:
+          api-level: 30
+          target: google_apis
+          arch: x86_64
+          script: python -m unittest tests.test_suite

+ 23 - 0
.github/workflows/python-distributions.yml

@@ -84,6 +84,28 @@ jobs:
           name: artifact-${{ matrix.build-identifier }}
           path: ./wheelhouse/*.whl
 
+  build-android-wheels:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - uses: actions/setup-python@v5
+        with:
+          cache: pip
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install setuptools wheel cibuildwheel setuptools-rust
+      - name: Build Android wheels
+        run: python -m cibuildwheel --output-dir wheelhouse
+        env:
+          CIBW_PLATFORM: android
+          CIBW_ARCHS_ANDROID: arm64_v8a x86_64
+      - name: Upload Android wheels
+        uses: actions/upload-artifact@v4
+        with:
+          name: artifact-android
+          path: ./wheelhouse/*.whl
+
   build-pure-wheels:
     runs-on: ubuntu-latest
     steps:
@@ -146,6 +168,7 @@ jobs:
     runs-on: ubuntu-latest
     needs:
       - build-wheels
+      - build-android-wheels
       - build-sdist
       - build-pure-wheels
     if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/dulwich-')

+ 0 - 19
dulwich/stdint.h

@@ -1,19 +0,0 @@
-/**
- * Replacement of gcc' stdint.h for MSVC
- */
-
-#ifndef STDINT_H
-#define STDINT_H
-
-typedef signed char       int8_t;
-typedef signed short      int16_t;
-typedef signed int        int32_t;
-typedef signed long long  int64_t;
-
-typedef unsigned char       uint8_t;
-typedef unsigned short      uint16_t;
-typedef unsigned int        uint32_t;
-typedef unsigned long long  uint64_t;
-
-
-#endif