Skip to content

Commit

Permalink
readd ci-integration function
Browse files Browse the repository at this point in the history
  • Loading branch information
chrira committed Nov 12, 2024
1 parent b988bf7 commit c65e996
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/dagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- dagger-ci
jobs:
lint:
pipeline:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
Expand Down
34 changes: 34 additions & 0 deletions ci/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"dagger/ci/internal/dagger"
"fmt"
"sync"
)

type Ci struct{}
Expand Down Expand Up @@ -163,3 +164,36 @@ func (m *Ci) Ci(ctx context.Context, dir *dagger.Directory) *Results {
Image: image,
}
}

// Executes all the steps and returns a Results object
func (m *Ci) CiIntegration(ctx context.Context, dir *dagger.Directory) *Results {
var wg sync.WaitGroup
wg.Add(3)

var lintOutput, _ = func() (string, error) {
defer wg.Done()
return "empty", error(nil) //m.Lint(ctx, dir)
}()

var securityScan = func() *dagger.File {
defer wg.Done()
return m.Sast(ctx, dir)
}()

//vulnerabilityScan := m.Vulnscan(ctx, m.SbomBuild(ctx, dir))

var image = func() *dagger.Container {
defer wg.Done()
return m.Build(ctx, dir)
}()

// This Blocks the execution until its counter become 0
wg.Wait()

return &Results{
LintOutput: lintOutput,
SecurityScan: securityScan,
// VulnerabilityScan: vulnerabilityScan,
Image: image,
}
}

0 comments on commit c65e996

Please sign in to comment.