diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e9a166e..4bf7a8e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,20 +1,59 @@ name: build -on: [push] +on: [push, pull_request] jobs: - build: - name: Build + test: + name: Test runs-on: ubuntu-latest steps: - - name: Set up Go 1.14 uses: actions/setup-go@v1 with: go-version: 1.14 id: go - - - name: Check out code into the Go module directory + - name: Check out uses: actions/checkout@v2 - - name: Test run: go test -v ./... + + build-1-13: + name: Build on Go 1.13 + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.13 + uses: actions/setup-go@v1 + with: + go-version: 1.13 + id: go + - name: Check out + uses: actions/checkout@v2 + - name: Build + run: go build . + + build-1-12: + name: Build on Go 1.12 + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.12 + uses: actions/setup-go@v1 + with: + go-version: 1.12 + id: go + - name: Check out + uses: actions/checkout@v2 + - name: Build + run: go build . + + build-1-11: + name: Build on Go 1.11 + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.11 + uses: actions/setup-go@v1 + with: + go-version: 1.11 + id: go + - name: Check out + uses: actions/checkout@v2 + - name: Build + run: go build . diff --git a/codegen/codegen.go b/codegen/codegen.go index 8efc0e4..69ca195 100644 --- a/codegen/codegen.go +++ b/codegen/codegen.go @@ -23,7 +23,7 @@ func Generate(projectName, frontend string) { func (g generator) generate() { fmt.Println("Generating", g.projectName) for path, srcText := range static.Sources() { - srcText = strings.ReplaceAll(srcText, "project-name", g.projectName) + srcText = strings.Replace(srcText, "project-name", g.projectName, -1) binary := []byte(srcText) g.processFile(path, binary) }