Skip to content

Commit

Permalink
Optimize CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ptgoetz committed Sep 10, 2024
1 parent e0115a6 commit 4cb98d9
Showing 1 changed file with 55 additions and 3 deletions.
58 changes: 55 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: VersionBump CI

on:
push:
Expand All @@ -11,9 +11,10 @@ on:
- '**'

jobs:
build:
setup:
runs-on: ubuntu-latest

outputs:
cache-key: ${{ steps.cache-deps.outputs.cache-hit }}
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -23,11 +24,62 @@ jobs:
with:
go-version: '1.22.2'

- name: Cache Go modules
id: cache-deps
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: make init-project

test:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.2'

- name: Restore Go modules cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ needs.setup.outputs.cache-key }}

- name: Run tests
run: make test

lint:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.2'

- name: Restore Go modules cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ needs.setup.outputs.cache-key }}

- name: Run lint checks
run: make lint

0 comments on commit 4cb98d9

Please sign in to comment.