1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-29 13:01:14 +03:00

ci: add MSVC and UWP builds to GitHub Actions

- add MSVC jobs to GitHub Actions. They are similar to the 'Build-only'
  jobs we have on AppVeyor CI, though only the ARM64 Windows one is
  identical. Major disadvantage is that we don't run tests here. Major
  advantage is they only take a few minutes to complete, compared to
  an hour on AppVeyor, so WinCNG build results now appear quicker.

  Docker tests might be possible, but my light attempts failed.
  Finding ZLIB also failed, so we still miss an MSVC test with it.

  Tool versions as of now: Server 2022, VS2022, OpenSSL 1.1.1

- add UWP builds for both ARM64 and x64. This hasn't been CI tested
  before.

  (We could probably enable UWP on AppVeyor CI as well.
  I haven't tried.)

- fix two uncovered UWP issues in tests.

- rename internal macro `LIBSSH2_WINDOWS_APP` to `LIBSSH2_WINDOWS_UWP`.

  Follow-up to 2addafb77b

- fold long lines and quote truthy values in `.github/workflows/ci.yml`.

Closes #1010
This commit is contained in:
Viktor Szakats
2023-04-26 21:43:45 +00:00
parent 23029a9d36
commit f4a4c05dc3
5 changed files with 67 additions and 20 deletions

View File

@ -61,6 +61,14 @@
#define LIBSSH2_SOCKET_MASK "%d"
#endif
#ifdef LIBSSH2_WINDOWS_UWP
#define popen(x, y) (NULL)
#define pclose(x) (-1)
#elif defined(WIN32)
#define popen _popen
#define pclose _pclose
#endif
static int have_docker = 0;
int openssh_fixture_have_docker(void)
@ -102,11 +110,7 @@ static int run_command_varg(char **output, const char *command, va_list args)
}
fprintf(stdout, "Command: %s\n", command_buf);
#ifdef WIN32
pipe = _popen(buf, "r");
#else
pipe = popen(buf, "r");
#endif
if(!pipe) {
fprintf(stderr, "Unable to execute command '%s'\n", command);
return -1;
@ -118,11 +122,7 @@ static int run_command_varg(char **output, const char *command, va_list args)
buf_len = strlen(buf);
}
#ifdef WIN32
ret = _pclose(pipe);
#else
ret = pclose(pipe);
#endif
if(ret) {
fprintf(stderr, "Error running command '%s' (exit %d): %s\n",
command, ret, buf);