Skip to content

Commit

Permalink
anekdot:
Browse files Browse the repository at this point in the history
  • Loading branch information
Qaleka committed Dec 16, 2024
1 parent b100153 commit 86a3130
Showing 1 changed file with 25 additions and 28 deletions.
53 changes: 25 additions & 28 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ on:
jobs:
build-lint-test-and-push:
runs-on: ubuntu-latest
services:
redis:
image: redis:alpine
ports:
- 6379:6379
minio:
image: minio/minio
ports:
- 9000:9000
- 8070:9001

steps:
# 1. Checkout repository
Expand All @@ -28,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23.1'

# 3. Install dependencies
- name: Install Go dependencies
Expand All @@ -37,26 +27,16 @@ jobs:
go get ./...
go mod vendor
# 4. Install golangci-lint
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
# 5. Run linter
- name: Run golangci-lint
run: |
golangci-lint run --verbose
# 6. Run tests
# 4. Run tests
- name: Run Go tests
run: |
go test -coverpkg=./... -coverprofile=cover ./... && cat cover | grep -v "mock" | grep -v "easyjson" | grep -v "proto" | grep -v "pb" > cover.out && go tool cover -func=cover.out
# 7. Login to DockerHub
# 5. Login to DockerHub
- name: Login to DockerHub Registry
run: echo ${{secrets.DOCKERHUB_TOKEN}} | docker login -u ${{secrets.DOCKERHUB_USERNAME}} --password-stdin

# 8. Build ads_service
# 6. Build ads_service
- name: Build and push ads_service
uses: docker/build-push-action@v4
with:
Expand All @@ -65,7 +45,7 @@ jobs:
tags: ${{secrets.DOCKERHUB_USERNAME}}/ads_service:latest
push: true

# 9. Build auth_service
# 7. Build auth_service
- name: Build and push auth_service
uses: docker/build-push-action@v4
with:
Expand All @@ -74,7 +54,7 @@ jobs:
tags: ${{secrets.DOCKERHUB_USERNAME}}/auth_service:latest
push: true

# 10. Build city_service
# 8. Build city_service
- name: Build and push city_service
uses: docker/build-push-action@v4
with:
Expand All @@ -83,7 +63,7 @@ jobs:
tags: ${{secrets.DOCKERHUB_USERNAME}}/city_service:latest
push: true

# 11. Build migrator
# 9. Build migrator
- name: Build and push migrator
uses: docker/build-push-action@v4
with:
Expand All @@ -92,11 +72,28 @@ jobs:
tags: ${{secrets.DOCKERHUB_USERNAME}}/migrator:latest
push: true

# 12. Build backend (main service)
# 10. Build backend (main service)
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
tags: ${{secrets.DOCKERHUB_USERNAME}}/backend:latest
push: true

lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23.1'
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- name: Run golangci-lint
run: golangci-lint run ./...

0 comments on commit 86a3130

Please sign in to comment.