-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
128 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Testing | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v1 | ||
with: | ||
version: v1.27 | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
needs: [lint] | ||
|
||
services: | ||
postgres: | ||
image: postgres:9.6-alpine | ||
ports: | ||
- "5432" | ||
env: | ||
POSTGRES_USER: test | ||
POSTGRES_PASSWORD: test | ||
POSTGRES_DB: test | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
mysql: | ||
image: mysql:5.7 | ||
ports: | ||
- "3306" | ||
env: | ||
MYSQL_ROOT_PASSWORD: test | ||
MYSQL_DATABASE: test | ||
MYSQL_USER: test | ||
MYSQL_PASSWORD: test | ||
options: >- | ||
--health-cmd "mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Run tests | ||
if: success() | ||
run: go test -cover ./... -coverprofile=coverage.txt -covermode=atomic | ||
env: | ||
TEST_POSTGRES: postgres://test:test@localhost:${{ job.services.postgres.ports[5432] }}/?sslmode=disable | ||
TEST_MYSQL: root:test@tcp(localhost:${{ job.services.mysql.ports[3306] }})/?charset=utf8 | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
if: success() | ||
with: | ||
file: ./coverage.txt | ||
fail_ci_if_error: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# See https://golangci-lint.run/usage/configuration/#config-file for more information | ||
run: | ||
timeout: 5m | ||
linters: | ||
disable-all: true | ||
enable: | ||
- gofmt | ||
- golint | ||
- goimports | ||
fast: false | ||
linters-settings: | ||
gofmt: | ||
simplify: false | ||
issues: | ||
exclude-use-default: false |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/hellofresh/klepto | ||
|
||
go 1.13 | ||
go 1.14 | ||
|
||
require ( | ||
github.com/BurntSushi/toml v0.3.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters