Skip to content

Commit

Permalink
Merge pull request #2 from imiller31/ismille/workflows
Browse files Browse the repository at this point in the history
adding workflows
  • Loading branch information
imiller31 authored Jan 11, 2022
2 parents 96250a2 + ee6b27c commit 82583c6
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/draftv2-integrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Go

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: make
run: make

- uses: actions/upload-artifact@v2
with:
name: draftv2-binary
path: ./draftv2
if-no-files-found: error

gomod-helm:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: draftv2-binary
- run: chmod +x ./draftv2
- run: ./draftv2 -v create -c ./test/go/configs/helm.yaml ./test/go/
- name: start minikube
id: minikube
uses: medyagh/setup-minikube@master
- run: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && sudo install skaffold /usr/local/bin/
- run: cd ./test/go && skaffold run

gomod-kustomize:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: draftv2-binary

- run: sudo apt-get install expect

- run: chmod +x ./draftv2

- run: ./draftv2 -v create -c ./test/go/configs/kustomize.yaml ./test/go/
- name: start minikube
id: minikube
uses: medyagh/setup-minikube@master
- run: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && sudo install skaffold /usr/local/bin/
- run: cd ./test/go && skaffold init --force
- run: cd ./test/go && skaffold run

8 changes: 8 additions & 0 deletions test/go/configs/helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
deployType: "Helm"
languageType: "gomodule"
deployVariables:
- name: "PORT"
value: "8080"
languageVariables:
- name: "PORT"
value: "8080"
8 changes: 8 additions & 0 deletions test/go/configs/kustomize.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
deployType: "kustomize"
languageType: "gomodule"
deployVariables:
- name: "PORT"
value: "8080"
languageVariables:
- name: "PORT"
value: "8080"
3 changes: 3 additions & 0 deletions test/go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/imiller31/draftv2/test/go_echo

go 1.16
33 changes: 33 additions & 0 deletions test/go/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package main

import (
"fmt"
"net/http"

"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)

func getGhost(c echo.Context) error {
return c.String(http.StatusOK, "hello\n")
}

func getEcho(c echo.Context) error {
return c.String(http.StatusOK, fmt.Sprintf("%s %s\n", c.Param("statement"), c.Param("statement")))
}

func main() {
// Echo instance
e := echo.New()

// Middleware
e.Use(middleware.Logger())
e.Use(middleware.Recover())

// Route => handler
e.GET("/echo/:statement", getEcho)
e.GET("*", getGhost)

// Start server
e.Logger.Fatal(e.Start(":8080"))
}

0 comments on commit 82583c6

Please sign in to comment.