mirror of
https://gitea.com/gitea/act_runner
synced 2026-11-03 10:57:22 +01:00
Adds a weekly and on-demand workflow that runs the cross-compiled tests on Windows Server 2025 Core in a [dockur/windows](https://github.com/dockur/windows) QEMU VM, and fixes the Windows bugs it found in host and UNC paths, env handling, shell quoting, post-task scripts, health checks, checkout, action symlinks, step summaries, Git client certificates and docker mode from a Windows host. Host-mode steps now emit UTF-8, `bash` falls back to Git's bash instead of the WSL launcher, the runner can run as a native Windows service, steps can keep background helpers with `RUNNER_TRACKING_ID`, and Windows arm64 binaries are released. Fixes: https://gitea.com/gitea/runner/issues/1339 Fixes: https://gitea.com/gitea/runner/issues/637 Fixes: https://gitea.com/gitea/runner/issues/1172 Fixes: https://gitea.com/gitea/runner/issues/347 Reviewed-on: https://gitea.com/gitea/runner/pulls/1348 Reviewed-by: bircni <bircni@icloud.com>
44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package runner
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"gitea.com/gitea/runner/act/common/logging"
|
|
"gitea.com/gitea/runner/act/common/logging/logtest"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestRunEventHostEnvironmentUTF8(t *testing.T) {
|
|
handler := logtest.New()
|
|
t.Cleanup(func() {
|
|
if t.Failed() {
|
|
for _, record := range handler.AllRecords() {
|
|
stepIDs, _ := record.Attr("stepID")
|
|
t.Logf("stepID=%v: %s", stepIDs, record.Message)
|
|
}
|
|
}
|
|
})
|
|
table := TestJobFileInfo{
|
|
workdir: workdir,
|
|
workflowPath: "windows-utf8",
|
|
eventName: "push",
|
|
platforms: map[string]string{"windows-latest": "-self-hosted"},
|
|
}
|
|
table.runTest(WithJobLoggerFactory(t.Context(), factoryFunc(func() logging.Handler { return handler })), t, &Config{Env: testCheckoutEnv()})
|
|
var outputSteps []string
|
|
for _, record := range handler.AllRecords() {
|
|
if strings.TrimRight(record.Message, "\r\n") == "你好,世界" {
|
|
stepIDs, ok := record.Attr("stepID")
|
|
require.True(t, ok)
|
|
outputSteps = append(outputSteps, stepIDs.([]string)...)
|
|
}
|
|
}
|
|
assert.Equal(t, []string{"cmd", "pwsh", "powershell"}, outputSteps)
|
|
}
|