Skip to content

Commit

Permalink
chore: Coverageのとり方を新しくする #147 (#148)
Browse files Browse the repository at this point in the history
* fix coverage

* delete

* fix version

* yamllint
  • Loading branch information
jiro4989 authored Mar 29, 2022
1 parent cf5d472 commit 56c25cc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 57 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: release

on:
"on":
push:
tags:
- 'v*.*.*'
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ name: test
- README*
- LICENSE

env:
goversion: '1.17'

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -22,7 +25,6 @@ jobs:
go:
- '1.17'
- '1.x'
name: build go ${{ matrix.go }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand All @@ -38,7 +40,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.17'
go-version: ${{ env.goversion }}
- name: Check code format
run: |
go mod download
Expand All @@ -63,7 +65,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.17'
go-version: ${{ env.goversion }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -73,6 +75,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build base image
run: docker-compose run coverage
- uses: actions/setup-go@v3
with:
go-version: ${{ env.goversion }}
- run: go test -coverprofile=coverage.out ./...
- uses: codecov/codecov-action@v2.1.0
10 changes: 0 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ RUN go install

################################################################################

FROM base AS coverage

RUN go get \
github.com/onsi/gomega \
github.com/onsi/ginkgo \
golang.org/x/tools/cmd/cover \
;

################################################################################

FROM alpine:3.13 AS runtime
COPY --from=builder /go/bin/textimg /usr/local/bin/
COPY --from=builder /tmp/MyricaM.TTC /usr/share/fonts/truetype/myrica/MyricaM.TTC
Expand Down
15 changes: 2 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

version: '3.7'

services:
Expand Down Expand Up @@ -27,18 +29,5 @@ services:
volumes:
- "$PWD/images:/images"

coverage:
<<: *common
build:
context: ./
dockerfile: ./Dockerfile
target: coverage
container_name: textimg_coverage
image: jiro4989/textimg-coverage
depends_on:
- base
entrypoint:
- scripts/merge_coverage_profile.sh

volumes:
gopkg:
28 changes: 0 additions & 28 deletions scripts/merge_coverage_profile.sh

This file was deleted.

0 comments on commit 56c25cc

Please sign in to comment.