GitHub CI: add MSVC jobs
authorKirill Isakov <bootctl@gmail.com>
Fri, 25 Mar 2022 12:16:17 +0000 (18:16 +0600)
committerKirill Isakov <bootctl@gmail.com>
Mon, 28 Mar 2022 15:38:29 +0000 (21:38 +0600)
.ci/windows/build.cmd [new file with mode: 0644]
.ci/windows/test.cmd [new file with mode: 0644]
.github/workflows/test.yml

diff --git a/.ci/windows/build.cmd b/.ci/windows/build.cmd
new file mode 100644 (file)
index 0000000..6cafcac
--- /dev/null
@@ -0,0 +1,8 @@
+set crypto=%1
+set builddir=%crypto%
+
+echo configure build directory
+meson setup %builddir% -Dbuildtype=release -Dcrypto=%crypto% || exit 1
+
+echo build project
+meson compile -C %builddir% || exit 1
diff --git a/.ci/windows/test.cmd b/.ci/windows/test.cmd
new file mode 100644 (file)
index 0000000..042740a
--- /dev/null
@@ -0,0 +1,24 @@
+set builddir=%1
+set data=%builddir%\test-data
+set tinc=%builddir%\src\tinc
+set tincd=%tinc%d
+
+mkdir %data% || exit 1
+
+echo can tinc run at all?
+%tinc% --version || exit 1
+
+echo try to initialize a node
+%tinc% -c %data% -b init foo || exit 1
+
+echo try to generate EC keys
+%tinc% -c %data% -b generate-ed25519-keys || exit 1
+
+echo can tincd run?
+%tincd% --version || exit 1
+
+echo bail out if we're missing support for the legacy protocol
+%tinc% --version | findstr legacy_protocol || exit 0
+
+echo try to generate RSA keys
+%tinc% -c %data% -b generate-keys || exit 1
index 0dd0de2..27f364b 100644 (file)
@@ -214,7 +214,7 @@ jobs:
     runs-on: ubuntu-latest
     needs:
       - linux
-      - windows
+      - mingw
 
     steps:
       - name: Create artifact directory
@@ -272,7 +272,7 @@ jobs:
           path: /tmp/logs/tests.*.tar.gz
         if: always()
 
-  windows:
+  mingw:
     runs-on: windows-latest
     timeout-minutes: 30
 
@@ -332,3 +332,41 @@ jobs:
           name: tests_windows
           path: /tmp/logs/tests.*.tar.gz
         if: always()
+
+  msvc:
+    runs-on: windows-latest
+    timeout-minutes: 30
+
+    strategy:
+      fail-fast: false
+      matrix:
+        arch:
+          - amd64
+          - amd64_x86
+
+    steps:
+      - name: Install meson
+        run: pip3 install meson
+
+      - name: Checkout code
+        uses: actions/checkout@v1
+
+      - name: Activate dev environment
+        uses: ilammy/msvc-dev-cmd@v1
+        with:
+          arch: ${{ matrix.arch }}
+
+      - name: Build (nolegacy)
+        run: .ci\windows\build.cmd nolegacy
+
+      - name: Test (nolegacy)
+        run: .ci\windows\test.cmd nolegacy
+        if: always()
+
+      - name: Build (OpenSSL)
+        run: .ci\windows\build.cmd openssl
+        if: always()
+
+      - name: Test (OpenSSL)
+        run: .ci\windows\test.cmd openssl
+        if: always()