Browse Source

Add tests to Windows CI

Rayyan Ansari 2 years ago
parent
commit
b19d2c1449
2 changed files with 14 additions and 3 deletions
  1. 10 3
      .github/workflows/windows.yml
  2. 4 0
      scripts/msys2-install-deps

+ 10 - 3
.github/workflows/windows.yml

@@ -1,6 +1,10 @@
 name: Windows CI
 on: [push, pull_request]
 
+env:
+  SETUPTOOLS_USE_DISTUTILS: stdlib # Needed for pip to work - https://www.msys2.org/docs/python/#known-issues
+  PY_COLORS: 1
+
 jobs:
   msys2-ucrt64:
     runs-on: windows-latest
@@ -16,12 +20,15 @@ jobs:
           msystem: UCRT64
           update: true
       - name: Install dependencies
-        run: ./scripts/msys2-install-deps
+        run: ./scripts/msys2-install-deps development
       - name: Build
         run: ./scripts/msys2-build
-      - name: Test
-        run: ./dist/borg.exe -V
       - uses: actions/upload-artifact@v3
         with:
           name: borg-windows
           path: dist/borg.exe
+      - name: Run tests
+        run: |
+          ./dist/borg.exe -V
+          pip install -e .
+          pytest --benchmark-skip -k "not remote"

+ 4 - 0
scripts/msys2-install-deps

@@ -2,3 +2,7 @@
 
 pacman -S --needed --noconfirm git mingw-w64-ucrt-x86_64-{toolchain,pkgconf,zstd,lz4,xxhash,openssl,python,cython,python-setuptools,python-wheel,python-pkgconfig,python-packaging,python-msgpack,python-argon2_cffi,python-pip}
 pip install pyinstaller
+
+if [ "$1" = "development" ]; then
+	pacman -S --needed --noconfirm mingw-w64-ucrt-x86_64-python-{pytest,pytest-benchmark,pytest-cov,pytest-forked,pytest-xdist}
+fi