Skip to content

Commit

Permalink
Version the generated files for go install command (#48)
Browse files Browse the repository at this point in the history
Fixes #47
  • Loading branch information
matm authored Mar 9, 2023
1 parent cbd9ea7 commit 599d085
Show file tree
Hide file tree
Showing 7 changed files with 421 additions and 19 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ jobs:
with:
go-version: 1.11

- name: Build code generation tool
run: go build -v ./cmd/generator

- name: Generate code
run: go generate ./...

- name: Build
run: go build -v ./cmd/gocov-html

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
*.swp
/*.css
// Generated Go files
*_gen.go
/build
/dist
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
v 1.4.0
v 1.3.1
- Version the generated files and restore the go install command. #47
- Add reverse order CLI flag. #41
- Add a tiny Dockerfile showing the build instructions. #44

Expand Down
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@ FROM golang:1.19-alpine3.16

RUN apk update && apk add git
RUN go install github.com/axw/gocov/gocov@latest
RUN git clone https://github.com/matm/gocov-html.git && \
cd gocov-html && \
go build github.com/matm/gocov-html/cmd/generator && \
go generate ./... && \
go install github.com/matm/gocov-html/cmd/gocov-html
RUN go install github.com/matm/gocov-html/cmd/gocov-html@latest
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ This is a simple helper tool for generating HTML output from [axw/gocov](https:/

Binaries for most amd64 systems are built for every release. Please just [grab a binary version of the latest release](https://github.com/matm/gocov-html/releases).

You can also build it from source. In this case, a working Go 1.11+ compiler is required.
You can also build it from source. In this case, a working Go 1.11+ compiler is required:

The easiest way to compile this tool is to fetch the repository's code and run `make` (which defaults to using the `build` target):
```bash
$ git clone https://github.com/matm/gocov-html.git
$ cd gocov-html
$ make
$ go install github.com/matm/gocov-html/cmd/gocov-html@latest
```

A [Dockerfile](Dockerfile) is also provided.
Expand All @@ -30,7 +27,7 @@ Embbed custom CSS into final HTML document|-|`1.2.0`
List available themes|`-lt`|`1.2.0`
Render with a specific theme|`-t <theme>`|`1.2.0`
New `kit` theme |`-t kit`|`1.3.0`
Put lower coverage functions on top|`-r`|`1.4.0`
Put lower coverage functions on top|`-r`|`1.3.1`

## Usage

Expand Down
133 changes: 133 additions & 0 deletions pkg/themes/default_gen.go

Large diffs are not rendered by default.

282 changes: 282 additions & 0 deletions pkg/themes/kit_gen.go

Large diffs are not rendered by default.

0 comments on commit 599d085

Please sign in to comment.