Skip to content

Commit c65e996

Browse files
committed
readd ci-integration function
1 parent b988bf7 commit c65e996

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

.github/workflows/dagger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
branches:
55
- dagger-ci
66
jobs:
7-
lint:
7+
pipeline:
88
runs-on: 'ubuntu-latest'
99
steps:
1010
- uses: actions/checkout@v4

ci/main.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"context"
1919
"dagger/ci/internal/dagger"
2020
"fmt"
21+
"sync"
2122
)
2223

2324
type Ci struct{}
@@ -163,3 +164,36 @@ func (m *Ci) Ci(ctx context.Context, dir *dagger.Directory) *Results {
163164
Image: image,
164165
}
165166
}
167+
168+
// Executes all the steps and returns a Results object
169+
func (m *Ci) CiIntegration(ctx context.Context, dir *dagger.Directory) *Results {
170+
var wg sync.WaitGroup
171+
wg.Add(3)
172+
173+
var lintOutput, _ = func() (string, error) {
174+
defer wg.Done()
175+
return "empty", error(nil) //m.Lint(ctx, dir)
176+
}()
177+
178+
var securityScan = func() *dagger.File {
179+
defer wg.Done()
180+
return m.Sast(ctx, dir)
181+
}()
182+
183+
//vulnerabilityScan := m.Vulnscan(ctx, m.SbomBuild(ctx, dir))
184+
185+
var image = func() *dagger.Container {
186+
defer wg.Done()
187+
return m.Build(ctx, dir)
188+
}()
189+
190+
// This Blocks the execution until its counter become 0
191+
wg.Wait()
192+
193+
return &Results{
194+
LintOutput: lintOutput,
195+
SecurityScan: securityScan,
196+
// VulnerabilityScan: vulnerabilityScan,
197+
Image: image,
198+
}
199+
}

0 commit comments

Comments
 (0)