-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix tests for stdout * Significant progess on official test suite * Pass all tests * Fix linting errors * Refactor CI * Add benchmark
- Loading branch information
Showing
138 changed files
with
1,261 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: go | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
cache-dependency-path: go.sum | ||
|
||
- name: Generate code | ||
run: go generate ./... | ||
working-directory: go | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
install-mode: goinstall | ||
version: latest | ||
working-directory: go | ||
args: --config="${GITHUB_WORKSPACE}/go/.golangci.yaml" | ||
|
||
test: | ||
name: test | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: go | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
cache-dependency-path: go.sum | ||
|
||
- name: Install dependencies | ||
run: go mod tidy | ||
|
||
- name: Generate code | ||
run: go generate ./... | ||
|
||
- name: Compile | ||
run: go build -v ./... | ||
|
||
- name: Run tests | ||
run: go test -v ./... | ||
|
||
benchmark: | ||
name: benchmark | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: go | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
cache-dependency-path: go.sum | ||
|
||
- name: Generate code | ||
run: go generate ./... | ||
|
||
- name: Run benchmark | ||
run: go test ./cmd/glox -bench=. -count 5 -run=^# -timeout 30m | tee output.txt | ||
|
||
- name: Download previous benchmark data | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./cache | ||
key: ${{ runner.os }}-benchmark | ||
|
||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
tool: 'go' | ||
output-file-path: go/output.txt | ||
external-data-json-path: ./cache/benchmark-data.json | ||
fail-on-alert: true | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
comment-on-alert: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
generated* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package {{ .Package }} | ||
|
||
{{- if eq (len .Imports) 1 }} | ||
import "{{ index .Imports 0 }}" | ||
{{- else }} | ||
import ( | ||
{{- range .Imports }} | ||
"{{ . }}" | ||
{{- end }} | ||
) | ||
{{- end }} | ||
|
||
{{ range .Types}} | ||
type {{ .Name }} struct { | ||
line int | ||
{{ range .Fields }}{{ .Name }} {{ .Type }} | ||
{{ end }} | ||
} | ||
|
||
func New{{ .Name }}(line int{{ range .Fields }}, {{ .Name }} {{ .Type }}{{ end }}) *{{ .Name }} { | ||
return &{{ .Name }}{ | ||
line: line, | ||
{{ range .Fields }}{{ .Name }}: {{ .Name }}, {{ end }} | ||
} | ||
} | ||
|
||
func (e {{ .Name }}) Line() int { | ||
return e.line | ||
} | ||
|
||
func (e {{ .Name }}) Kind() string { | ||
return "{{ $.ErrorKind }}" | ||
} | ||
|
||
func (e {{ .Name }}) Message() string { | ||
return fmt.Sprintf("{{ .Message }}", {{ range .Fields }}e.{{ .Name }}, {{ end }}) | ||
} | ||
{{ end }} |
Oops, something went wrong.