diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index b2ff1e0..5a662d6 100644 --- a/pkg/runner/run_context.go +++ b/pkg/runner/run_context.go @@ -267,8 +267,9 @@ func (rc *RunContext) createStepContainerName(stepID string) string { prefix := regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(rc.createContainerName(), "-") suffix := regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(stepID, "-") - containerName := trimToLen(prefix, 30-len(suffix)) - return fmt.Sprintf("%s%s%s", prefix, containerName, suffix) + prefix = trimToLen(prefix, 30-(1+len(suffix))) + name := strings.Trim(fmt.Sprintf("%s-%s", prefix, suffix), "-") + return name } func trimToLen(s string, l int) string { diff --git a/pkg/runner/runner_test.go b/pkg/runner/runner_test.go index b6f2c86..e4fb880 100644 --- a/pkg/runner/runner_test.go +++ b/pkg/runner/runner_test.go @@ -57,13 +57,13 @@ func TestRunEvent(t *testing.T) { table := table t.Run(table.workflowPath, func(t *testing.T) { platforms := map[string]string{ - "ubuntu-latest": "ubuntu:18.04", + "ubuntu-latest": "node:12.6-buster-slim", } runnerConfig := &Config{ Workdir: "testdata", EventName: table.eventName, Platforms: platforms, - ReuseContainers: true, + ReuseContainers: false, } runner, err := New(runnerConfig) assert.NilError(t, err, table.workflowPath) diff --git a/pkg/runner/testdata/node/push.yml b/pkg/runner/testdata/node/push.yml index 1be8946..0eebcf4 100644 --- a/pkg/runner/testdata/node/push.yml +++ b/pkg/runner/testdata/node/push.yml @@ -6,11 +6,12 @@ jobs: test: runs-on: ubuntu-latest steps: + - run: which node - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 12 registry-url: https://registry.npmjs.org/ - + - run: which node - name: Install Dependencies run: npm install