From fd079683c5832a668e105845a1ad3c78d9a2f63c Mon Sep 17 00:00:00 2001 From: Kareem Mahlees Date: Fri, 23 Feb 2024 20:32:14 +0200 Subject: [PATCH] ci: some fixes in caching and cleanup --- .github/workflows/codecov.yml | 26 ++++++++++++-------------- .github/workflows/lint.yml | 1 + 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 767146e..691c675 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,25 +1,23 @@ name: Test and coverage -on: [push, pull_request] +on: + push: + branches: + - master + - main + pull_request: + workflow_dispatch: jobs: build: runs-on: ubuntu-latest - services: - mysql: - image: mysql - ports: - - 33061:3306 - env: - MYSQL_ROOT_PASSWORD: kareem - MYSQL_DATABASE: mysqlmeta - MYSQL_USER: kareem - MYSQL_PASSWORD: password123 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 with: - go-version: "1.21" + cache: true + cache-dependency-path: "**/go.sum" + go-version-file: "./go.mod" - name: Run coverage run: go test ./... -race -coverprofile=coverage.out -covermode=atomic - name: Upload coverage to Codecov diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fd5f234..db20ddf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,6 +5,7 @@ on: - master - main pull_request: + workflow_dispatch: permissions: contents: read