Skip to content

Commit

Permalink
Merge pull request #691 from traPtitech/dockertest
Browse files Browse the repository at this point in the history
dockertestの導入
  • Loading branch information
ikura-hamu authored Sep 30, 2023
2 parents 19b5e7d + 8bc511c commit 4b1e973
Show file tree
Hide file tree
Showing 18 changed files with 328 additions and 91 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- 'main'
- "main"
pull_request:

jobs:
Expand All @@ -19,21 +19,28 @@ jobs:
test:
name: Test
runs-on: ubuntu-latest
services:
dind:
image: docker:23.0-rc-dind-rootless
ports:
- 2375:2375
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
- run: go generate ./...
- run: docker compose -f docker/test/compose.yaml up --abort-on-container-exit
- run: mkdir -p /tmp/coverage
- name: Run test
run: go test ./src/... -v -coverprofile=/tmp/coverage/coverage.txt -race -vet=off
- name: Upload coverage data
uses: codecov/[email protected]
with:
file: ./tmp/coverage/coverage.txt
file: /tmp/coverage/coverage.txt
- uses: actions/upload-artifact@v3
with:
name: coverage.txt
path: ./tmp/coverage/coverage.txt
path: /tmp/coverage/coverage.txt
lint:
name: Lint
runs-on: ubuntu-latest
Expand Down
6 changes: 0 additions & 6 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,10 @@ tasks:

test:
cmds:
- task: test:down
- task: os:test
- task: test:down
deps:
- generate

test:down:
cmds:
- task: os:test:down

tbls:
cmds:
- task: os:tbls
Expand Down
1 change: 1 addition & 0 deletions docker/base/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
S3_REGION: us-east-1
S3_BUCKET: trap-collection
S3_ENDPOINT: http://s3:9000
S3_USE_PATH_STYLE: false
PORT: :3000
depends_on:
mariadb:
Expand Down
13 changes: 0 additions & 13 deletions docker/test/Dockerfile

This file was deleted.

26 changes: 0 additions & 26 deletions docker/test/compose.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ require (
github.com/labstack/echo/v4 v4.11.1
github.com/ncw/swift/v2 v2.0.2
github.com/oapi-codegen/runtime v1.0.0
github.com/ory/dockertest/v3 v3.10.0
github.com/stretchr/testify v1.8.4
golang.org/x/mod v0.12.0
golang.org/x/sync v0.3.0
Expand All @@ -28,7 +29,10 @@ require (

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 // indirect
Expand All @@ -46,15 +50,24 @@ require (
github.com/aws/smithy-go v1.14.2 // indirect
github.com/bep/godartsass v0.16.0 // indirect
github.com/bep/golibsass v1.1.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cli/safeexec v1.0.0 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/creack/pty v1.1.18 // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
github.com/docker/docker v20.10.7+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gohugoio/hugo v0.111.3 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/invopop/yaml v0.2.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/joho/godotenv v1.5.1 // indirect
Expand All @@ -63,15 +76,24 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-zglob v0.0.4 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.5 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/radovskyb/watcher v1.0.7 // indirect
github.com/sajari/fuzzy v1.0.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tdewolff/parse/v2 v2.6.8 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
golang.org/x/exp v0.0.0-20230212135524-a684f29349b6 // indirect
golang.org/x/term v0.12.0 // indirect
Expand Down
Loading

0 comments on commit 4b1e973

Please sign in to comment.