Skip to content

Commit

Permalink
update demos (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
aweris authored Aug 16, 2023
1 parent e6289f4 commit 7685e4c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Explore `gale` through the following scenarios:
| Run | `--run` | Run golangci-lint job from ci/workflows/lint workflow for aweris/gale repository default branch |
| Lint GoReleaser | `--lint-goreleaser` | Run golangci job from golangci-lint workflow for goreleaser/goreleaser repository tag v1.19.2 |
| Test Dagger | `--test-dagger` | Run sdk-go job from test workflow for dagger/dagger repository tag v0.8.1 |

| Test Cache | `--test-cache` | Use actions/cache in the workflow |

## Getting Started

Expand Down
4 changes: 2 additions & 2 deletions demo/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package main

const (
BinDir = "./bin"
DaggerVersion = "0.8.1"
GaleVersion = "v0.0.3"
DaggerVersion = "0.8.2"
GaleVersion = "v0.0.4"
)
21 changes: 17 additions & 4 deletions demo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ func main() {
d.Add(list(), "list", "List all workflows and jobs under it for current repositories `main` branch")
d.Add(run(), "run", "Run golangci-lint job from ci/workflows/lint workflow for aweris/gale repository default branch")
d.Add(lintGoreleaser(), "lint-goreleaser", "Run golangci job from golangci-lint workflow for goreleaser/goreleaser repository tag v1.19.2")
d.Add(testDagger(), "test-dagger", "Run sdk-go job from test workflow for dagger/dagger repository tag v0.8.1")
d.Add(testDagger(), "test-dagger", "Run sdk-go job from test workflow for dagger/dagger repository branch main")
d.Add(testCache(), "test-cache", "Use cache in the workflow")

d.Cleanup(env.Cleanup)

Expand Down Expand Up @@ -49,11 +50,23 @@ func lintGoreleaser() *demo.Run {
}

func testDagger() *demo.Run {
r := demo.NewRun("Run sdk-go job from test workflow for dagger v0.8.1")
r := demo.NewRun("Run sdk-go job from test workflow for dagger main")

r.Step([]string{"Contents of the workflow file"}, demo.S("curl https://raw.githubusercontent.com/dagger/dagger/v0.8.1/.github/workflows/test.yml"))
r.Step([]string{"Contents of the workflow file"}, demo.S("curl https://raw.githubusercontent.com/dagger/dagger/main/.github/workflows/test.yml"))

r.Step([]string{"Run the workflow from custom directory for dagger/dagger repository"}, env.RunGaleWithDagger("run --repo dagger/dagger --tag v0.8.1 test sdk-go"))
r.Step([]string{"Run the workflow from custom directory for dagger/dagger repository"}, env.RunGaleWithDagger("run --repo dagger/dagger --branch main test sdk-go"))

return r
}

func testCache() *demo.Run {
r := demo.NewRun("Use cache")

r.Step([]string{"Contents of the workflow file"}, demo.S("curl https://raw.githubusercontent.com/aweris/gale/main/ci/workflows/artifact-cache.yaml"))

r.Step([]string{"What we expect to see here", "if cache exist, it'll print contents of the cache file", "if cache doesn't exist, it'll generate a new file, use it then upload it to cache"}, nil)

r.Step([]string{"Run the workflow"}, env.RunGaleWithDagger("run --repo aweris/gale --workflows-dir ci/workflows ci/workflows/artifact-cache.yaml test"))

return r
}

0 comments on commit 7685e4c

Please sign in to comment.