Skip to content

Commit

Permalink
Build and test caddy with xtemplate plugin in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
infogulch committed Sep 30, 2024
1 parent 53e0924 commit a7eea62
Show file tree
Hide file tree
Showing 11 changed files with 239 additions and 179 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
go-version: '1.22'
- uses: gacts/install-hurl@v1
- uses: cue-lang/[email protected]
- run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest

- name: Login to Docker Hub
uses: docker/login-action@v3
Expand All @@ -25,6 +26,13 @@ jobs:
# CUE_DEBUG_TOOLS_FLOW=true cue cmd ci
- run: cue cmd ci

- uses: actions/upload-artifact@v4
with:
name: logs
path: |
test/*.log
test/report/
- uses: actions/upload-artifact@v4
with:
name: xtemplate-amd64-linux
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ designs, otherwise they'll be in the way of the fundamentals:
>
> ```html
> <ul>
> {{range .Tx.Query `SELECT id,name FROM contacts`}}
> {{range .DB.Query `SELECT id,name FROM contacts`}}
> <li><a href="/contact/{{.id}}">{{.name}}</a></li>
> {{end}}
> </ul>
Expand Down Expand Up @@ -274,6 +274,8 @@ routes {
}
```
Alternatively, build with the `xcaddy` CLI tool.
### 2. 📦 As the default CLI application
Download from the [Releases page](https://github.com/infogulch/xtemplate/releases) or build the binary in [`./cmd`](./cmd/).
Expand Down
11 changes: 5 additions & 6 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@

### Documentation

- [ ] Documentation
- [ ] Using different databases
- Should be documented with DotDBProvider go docs (?)
- [ ] Using the new go-arg cli flags
- [ ] Using json config
- [ ] Creating a provider
- [ ] Using different databases
- Should be documented with DotDBProvider go docs (?)
- [ ] Using the new go-arg cli flags
- [ ] Using json config
- [ ] Creating a provider

### Application

Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Config struct {
// The path to the templates directory. Default `templates`.
TemplatesDir string `json:"templates_dir,omitempty" arg:"-t,--template-dir" default:"templates"`

// The FS to load templates from. Overrides Path if not nil.
// The FS to load templates from. Overrides TemplatesDir if not nil.
TemplatesFS fs.FS `json:"-" arg:"-"`

// File extension to search for to find template files. Default `.html`.
Expand Down
54 changes: 25 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,57 +1,53 @@
module github.com/infogulch/xtemplate

go 1.22.1
go 1.22.3

require (
github.com/BurntSushi/toml v1.3.2
github.com/Masterminds/sprig/v3 v3.2.3
github.com/alecthomas/chroma/v2 v2.13.0
github.com/alexflint/go-arg v1.5.0
github.com/BurntSushi/toml v1.4.0
github.com/Masterminds/sprig/v3 v3.3.0
github.com/alecthomas/chroma/v2 v2.14.0
github.com/alexflint/go-arg v1.5.1
github.com/andybalholm/brotli v1.1.0
github.com/dustin/go-humanize v1.0.1
github.com/felixge/httpsnoop v1.0.4
github.com/google/uuid v1.6.0
github.com/infogulch/watch v0.2.0
github.com/klauspost/compress v1.17.8
github.com/mattn/go-sqlite3 v1.14.22
github.com/microcosm-cc/bluemonday v1.0.26
github.com/nats-io/nats-server/v2 v2.10.15
github.com/nats-io/nats.go v1.35.0
github.com/tdewolff/minify/v2 v2.20.24
github.com/yuin/goldmark v1.7.1
github.com/klauspost/compress v1.17.10
github.com/mattn/go-sqlite3 v1.14.23
github.com/microcosm-cc/bluemonday v1.0.27
github.com/nats-io/nats-server/v2 v2.10.21
github.com/nats-io/nats.go v1.37.0
github.com/tdewolff/minify/v2 v2.20.37
github.com/yuin/goldmark v1.7.4
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
gopkg.in/yaml.v3 v3.0.1
)

// Don't drink and drive, and don't change your repo's import path, kids.
// https://github.com/darccio/mergo/issues/244 🙄
// Pin mergo to v0.3.16
require github.com/imdario/mergo v0.3.16 // indirect

require (
dario.cat/mergo v1.0.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/alexflint/go-scalar v1.2.0 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/dlclark/regexp2 v1.11.0 // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gorilla/css v1.0.1 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/minio/highwayhash v1.0.3 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/nats-io/jwt/v2 v2.5.7 // indirect
github.com/nats-io/jwt/v2 v2.7.0 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/tdewolff/parse/v2 v2.7.14 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.5.0 // indirect
github.com/tdewolff/parse/v2 v2.7.15 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/time v0.6.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
Loading

0 comments on commit a7eea62

Please sign in to comment.