Skip to content

Commit

Permalink
ci: deleting cache go dependences
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeversiane committed Jun 14, 2024
1 parent 252f90d commit be177eb
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,14 @@ jobs:
with:
go-version-file: go.mod

- name: Cache Go dependencies
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download

- name: Build
run: go build -v ./...

- name: Test
run: |
make ci
run: go test -v ./internal/...

security:
runs-on: ubuntu-22.04
Expand All @@ -60,28 +51,32 @@ jobs:
uses: snyk/actions/golang@master
with:
args: --severity-threshold=critical

test:
needs: [build, security]
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- name: E2E Tests
test_command: go test -v ./e2e/...
steps:
- uses: actions/checkout@v3

- name: Set up Docker Compose
run: docker-compose -f docker-compose.ci.yml up -d --build --no-cache

- name: Run project
run: ${{ matrix.test_command }}
run: make ci

- name: Set up Go for E2E tests
uses: actions/setup-go@v3
with:
go-version-file: go.mod

- name: Run E2E tests
run: go test -v ./e2e/...

- name: Check Docker Compose status
- name: Get Docker Compose status
if: failure()
run: docker-compose -f docker-compose.ci.yml ps

- name: Get Docker Compose logs on failure
- name: Get Docker Compose logs
if: failure()
run: docker-compose -f docker-compose.ci.yml logs

Expand All @@ -103,14 +98,13 @@ jobs:
-path /migrations \
-database "${{ env.DB_URL }}" \
up
deploy:
needs: [migrate]
runs-on: ubuntu-latest
steps:
- name: Deploy API to Render
- name: Deploy API
run: |
curl -X POST \
-H "Content-Type: application/json" \
-d '{"branch": "main"}' \
${{ env.DEPLOY_HOOK }}
${{ env.DB_URL }}

0 comments on commit be177eb

Please sign in to comment.