Skip to content

Commit

Permalink
chore: update demo (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
aweris authored Aug 29, 2023
1 parent 3b76a3e commit 3205f8a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Explore `gale` through the following scenarios:
| List | `--list` | List all workflows and jobs under it for current repositories `main` branch |
| 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 |
| Shell run | `--shell-run` | Run example workflow contains steps with different shells |
| Test Dagger | `--test-dagger` | Run sdk-go job from test workflow for dagger/dagger repository branch main |
| Test Cache | `--test-cache` | Use actions/cache in the workflow |

Expand Down
2 changes: 1 addition & 1 deletion demo/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package main
const (
BinDir = "./bin"
DaggerVersion = "0.8.4"
GaleVersion = "v0.0.5"
GaleVersion = "v0.0.6"
)
11 changes: 11 additions & 0 deletions demo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ 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(shellRun(), "shell-run", "Run example workflow contains steps with different shells")
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")

Expand Down Expand Up @@ -49,6 +50,16 @@ func lintGoreleaser() *demo.Run {
return r
}

func shellRun() *demo.Run {
r := demo.NewRun("Run example workflow contains steps with different shells")

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

r.Step([]string{"Run the workflow from custom directory for current repository"}, env.RunGaleWithDagger("run --repo aweris/gale --workflows-dir ci/workflows shell run"))

return r
}

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

Expand Down

0 comments on commit 3205f8a

Please sign in to comment.