refactor: move act under internal

The runner is an application, not a library. `act/model` and
`act/exprparser` were the last packages anything outside this repository
consumed and they now live in actionslib, so nothing needs the rest of
`act` to be importable, and keeping it importable invites the coupling
that was just removed.

Import paths only, the files are unchanged.

Assisted-by: Codet:GPT-5.1-Codex
This commit is contained in:
Lunny Xiao
2026-08-07 21:40:48 -07:00
parent b66433e667
commit 825c6af07c
264 changed files with 93 additions and 93 deletions
+66
View File
@@ -0,0 +1,66 @@
// Copyright 2026 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package runner
import (
"testing"
"gitea.dev/actionslib/pkg/model"
"github.com/stretchr/testify/assert"
"go.yaml.in/yaml/v4"
)
func TestMaxParallelStrategy(t *testing.T) {
tests := []struct {
name string
maxParallelString string
expectedMaxParallel int
}{
{
name: "max-parallel-1",
maxParallelString: "1",
expectedMaxParallel: 1,
},
{
name: "max-parallel-2",
maxParallelString: "2",
expectedMaxParallel: 2,
},
{
name: "max-parallel-default",
maxParallelString: "",
expectedMaxParallel: 4,
},
{
name: "max-parallel-10",
maxParallelString: "10",
expectedMaxParallel: 10,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
matrix := map[string][]any{
"version": {1, 2, 3, 4, 5},
}
var rawMatrix yaml.Node
err := rawMatrix.Encode(matrix)
assert.NoError(t, err) //nolint:testifylint // pre-existing issue from nektos/act
job := &model.Job{
Strategy: &model.Strategy{
MaxParallelString: tt.maxParallelString,
RawMatrix: rawMatrix,
},
}
matrixes, err := job.GetMatrixes()
assert.NoError(t, err) //nolint:testifylint // pre-existing issue from nektos/act
assert.NotNil(t, matrixes)
assert.Len(t, matrixes, 5)
assert.Equal(t, tt.expectedMaxParallel, job.Strategy.MaxParallel)
})
}
}