38
.github/workflows/go.yml
vendored
Normal file
38
.github/workflows/go.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Go
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'db/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'db/**'
|
||||
|
||||
jobs:
|
||||
db-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.25'
|
||||
- name: go fmt
|
||||
run: go fmt ./...
|
||||
working-directory: db
|
||||
- name: Ensure formatting
|
||||
run: |
|
||||
if [ -n "$(gofmt -l .)" ]; then
|
||||
echo "Go files are not formatted"
|
||||
exit 1
|
||||
fi
|
||||
git diff --exit-code
|
||||
working-directory: db
|
||||
- name: go vet
|
||||
run: go vet ./...
|
||||
working-directory: db
|
||||
- name: go test
|
||||
run: go test ./...
|
||||
working-directory: db
|
||||
@@ -17,7 +17,7 @@ func init() {
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"indexes": [
|
||||
"CREATE INDEX ` + "`" + `idx_6tD5RqfVk2` + "`" + ` ON ` + "`" + `trails` + "`" + ` (` + "`" + `iri` + "`" + `)"
|
||||
"CREATE INDEX `+"`"+`idx_6tD5RqfVk2`+"`"+` ON `+"`"+`trails`+"`"+` (`+"`"+`iri`+"`"+`)"
|
||||
]
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
|
||||
@@ -17,7 +17,7 @@ func init() {
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"indexes": [
|
||||
"CREATE INDEX ` + "`" + `idx_hLtEU5XGWL` + "`" + ` ON ` + "`" + `lists` + "`" + ` (` + "`" + `iri` + "`" + `)"
|
||||
"CREATE INDEX `+"`"+`idx_hLtEU5XGWL`+"`"+` ON `+"`"+`lists`+"`"+` (`+"`"+`iri`+"`"+`)"
|
||||
]
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
|
||||
@@ -17,7 +17,7 @@ func init() {
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"indexes": [
|
||||
"CREATE UNIQUE INDEX ` + "`" + `idx_4T3m08OsP1` + "`" + ` ON ` + "`" + `comments` + "`" + ` (` + "`" + `iri` + "`" + `) WHERE iri IS NOT NULL AND iri != \"\";"
|
||||
"CREATE UNIQUE INDEX `+"`"+`idx_4T3m08OsP1`+"`"+` ON `+"`"+`comments`+"`"+` (`+"`"+`iri`+"`"+`) WHERE iri IS NOT NULL AND iri != \"\";"
|
||||
]
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
|
||||
@@ -17,7 +17,7 @@ func init() {
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"indexes": [
|
||||
"CREATE UNIQUE INDEX ` + "`" + `idx_hLtEU5XGWL` + "`" + ` ON ` + "`" + `lists` + "`" + ` (` + "`" + `iri` + "`" + `) WHERE iri IS NOT NULL AND iri != \"\";"
|
||||
"CREATE UNIQUE INDEX `+"`"+`idx_hLtEU5XGWL`+"`"+` ON `+"`"+`lists`+"`"+` (`+"`"+`iri`+"`"+`) WHERE iri IS NOT NULL AND iri != \"\";"
|
||||
]
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
@@ -33,7 +33,7 @@ func init() {
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"indexes": [
|
||||
"CREATE INDEX ` + "`" + `idx_hLtEU5XGWL` + "`" + ` ON ` + "`" + `lists` + "`" + ` (` + "`" + `iri` + "`" + `)"
|
||||
"CREATE INDEX `+"`"+`idx_hLtEU5XGWL`+"`"+` ON `+"`"+`lists`+"`"+` (`+"`"+`iri`+"`"+`)"
|
||||
]
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
|
||||
@@ -17,7 +17,7 @@ func init() {
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"indexes": [
|
||||
"CREATE UNIQUE INDEX ` + "`" + `idx_iSbmEqYXbV` + "`" + ` ON ` + "`" + `summit_logs` + "`" + ` (` + "`" + `iri` + "`" + `) WHERE iri IS NOT NULL AND iri != \"\";"
|
||||
"CREATE UNIQUE INDEX `+"`"+`idx_iSbmEqYXbV`+"`"+` ON `+"`"+`summit_logs`+"`"+` (`+"`"+`iri`+"`"+`) WHERE iri IS NOT NULL AND iri != \"\";"
|
||||
]
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
|
||||
@@ -17,7 +17,7 @@ func init() {
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"indexes": [
|
||||
"CREATE UNIQUE INDEX ` + "`" + `idx_6tD5RqfVk2` + "`" + ` ON ` + "`" + `trails` + "`" + ` (` + "`" + `iri` + "`" + `) WHERE iri IS NOT NULL AND iri != \"\";"
|
||||
"CREATE UNIQUE INDEX `+"`"+`idx_6tD5RqfVk2`+"`"+` ON `+"`"+`trails`+"`"+` (`+"`"+`iri`+"`"+`) WHERE iri IS NOT NULL AND iri != \"\";"
|
||||
]
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
@@ -33,7 +33,7 @@ func init() {
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"indexes": [
|
||||
"CREATE INDEX ` + "`" + `idx_6tD5RqfVk2` + "`" + ` ON ` + "`" + `trails` + "`" + ` (` + "`" + `iri` + "`" + `)"
|
||||
"CREATE INDEX `+"`"+`idx_6tD5RqfVk2`+"`"+` ON `+"`"+`trails`+"`"+` (`+"`"+`iri`+"`"+`)"
|
||||
]
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
|
||||
@@ -17,7 +17,7 @@ func init() {
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"indexes": [
|
||||
"CREATE UNIQUE INDEX ` + "`" + `idx_YbuWvsh5la` + "`" + ` ON ` + "`" + `trail_link_share` + "`" + ` (` + "`" + `trail` + "`" + `)"
|
||||
"CREATE UNIQUE INDEX `+"`"+`idx_YbuWvsh5la`+"`"+` ON `+"`"+`trail_link_share`+"`"+` (`+"`"+`trail`+"`"+`)"
|
||||
]
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user