Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #39 from cybozu-go/actions
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
ymmt2005 authored Dec 15, 2021
2 parents a75f5c9 + 9d6fea1 commit 2056399
Show file tree
Hide file tree
Showing 27 changed files with 1,816 additions and 48 deletions.
30 changes: 0 additions & 30 deletions .circleci/config.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Environments**
- Version:
- OS:

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Task
about: Describe this issue
title: ''
labels: ''
assignees: ''

---

## What

Describe what this issue should address.

## How

Describe how to address the issue.

## Checklist

- [ ] Finish implementation of the issue
- [ ] Test all functions
- [ ] Have enough logs to trace activities
- [ ] Notify developers of necessary actions
37 changes: 37 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI
on:
pull_request:
push:
branches:
- 'main'
env:
go-version: 1.17
cache-version: 1
jobs:
test:
name: Small tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ env.go-version }}
- run: test -z "$(gofmt -s -l . | tee /dev/stderr)"
- run: GOOS=windows go build .
- run: go build .
- run: go test -race -v .
- run: go vet .
- name: staticcheck
run: |
mkdir -p bin
GOBIN=$(pwd)/bin go install honnef.co/go/tools/cmd/staticcheck@latest
./bin/staticcheck .
- name: Restart test
run: |
go build ./test/restart
CANCELLATION_DELAY_SECONDS=0 ./restart
- name: Config test
run: |
cd ./test/spf13
go build .
./spf13 --config=.spf13.yml --loglevel=critical
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,3 @@ _testmain.go
*.prof

/restart

# ignore go.sum
/go.sum
1 change: 1 addition & 0 deletions exec_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package well
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/cybozu-go/well

require (
github.com/BurntSushi/toml v0.3.1
github.com/cybozu-go/log v1.5.0
github.com/cybozu-go/netutil v1.2.0
github.com/BurntSushi/toml v0.4.1
github.com/cybozu-go/log v1.6.1
github.com/cybozu-go/netutil v1.4.2
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.3.2
golang.org/x/net v0.0.0-20190921015927-1a5e07d1ff72
github.com/spf13/viper v1.10.0
golang.org/x/net v0.0.0-20211209124913-491a49abca63
)

go 1.13
814 changes: 814 additions & 0 deletions go.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions graceful_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package well
Expand Down
2 changes: 1 addition & 1 deletion graceful_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package well
Expand Down Expand Up @@ -119,7 +120,6 @@ func (g *Graceful) Run() {

// child process should not return.
os.Exit(0)
return
}

// runMaster is the main function of the master process.
Expand Down
1 change: 1 addition & 0 deletions graceful_unix_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package well
Expand Down
1 change: 1 addition & 0 deletions graceful_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package well
Expand Down
3 changes: 1 addition & 2 deletions http.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build go1.8
// +build go1.8

package well
Expand Down Expand Up @@ -83,7 +84,6 @@ type StdResponseWriter interface {
http.ResponseWriter
io.ReaderFrom
http.Flusher
http.CloseNotifier
http.Hijacker
WriteString(data string) (int, error)
}
Expand All @@ -95,7 +95,6 @@ type StdResponseWriter interface {
type StdResponseWriter2 interface {
http.ResponseWriter
http.Flusher
http.CloseNotifier
http.Pusher
WriteString(data string) (int, error)
}
Expand Down
1 change: 1 addition & 0 deletions http_17.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !go1.8
// +build !go1.8

package well
Expand Down
2 changes: 1 addition & 1 deletion http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ func TestHTTPClient(t *testing.T) {
logger.SetThreshold(log.LvDebug)

req = req.WithContext(ctx)
resp, err = cl.Do(req)
_, err = cl.Do(req)
if err != nil {
t.Fatal(err)
}
Expand Down
1 change: 1 addition & 0 deletions log_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package well
Expand Down
1 change: 1 addition & 0 deletions logfile.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package well
Expand Down
6 changes: 3 additions & 3 deletions sigpipe.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package well
Expand Down Expand Up @@ -52,8 +53,7 @@ func handleSigPipe() {
}

// signal.Ignore does NOT ignore signals; instead, it just stop
// relaying signals to the channel. Instead, we use an unbuffered
// channel to discard SIGPIPE.
c := make(chan os.Signal)
// relaying signals to the channel. Instead, we set a nop handler.
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGPIPE)
}
1 change: 1 addition & 0 deletions stopsig.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package well
Expand Down
7 changes: 7 additions & 0 deletions systemd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ func TestIsSystemdService(t *testing.T) {
return
}

if os.Getenv("GITHUB_ACTIONS") == "true" {
if !IsSystemdService() {
t.Error(`GitHub Actions is run as a systemd service`)
}
return
}

if IsSystemdService() {
t.Error(`IsSystemdService()`)
}
Expand Down
1 change: 1 addition & 0 deletions test/restart/restart.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package main
Expand Down
1 change: 1 addition & 0 deletions test/restart/restart_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package main
Expand Down
1 change: 0 additions & 1 deletion test/spf13/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/spf13
/*.go
35 changes: 35 additions & 0 deletions test/spf13/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module github.com/cybozu-go/well/test/spf13

go 1.17

replace github.com/cybozu-go/well => ../..

require (
github.com/cybozu-go/log v1.6.1
github.com/cybozu-go/well v1.10.0
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.10.0
)

require (
github.com/cybozu-go/netutil v1.4.2 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/onsi/gomega v1.14.0 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/vishvananda/netlink v1.1.0 // indirect
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit 2056399

Please sign in to comment.