Skip to content

Commit

Permalink
Move lint to seperate file, move setup go to another acition
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKalke committed May 6, 2024
1 parent 38328a0 commit 7cfcf3e
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 27 deletions.
14 changes: 14 additions & 0 deletions .github/actions/setup-go/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Setup go'
description: 'Action for the go setup'

env:
SETUP_GO_VERSION: '1.22'

runs:
using: 'composite'
steps:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}

39 changes: 39 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Lint

on:
push:
branches: [ "main", "release-*" ]
pull_request:
paths-ignore:
- 'docs/**'
- 'examples/**'
types:
- opened
- reopened
- synchronize
- ready_for_review
- converted_to_draft

jobs:
operator-lint:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: 'components/operator'

serverless-lint:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-libgit2
- uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: 'components/serverless'
13 changes: 0 additions & 13 deletions .github/workflows/operator-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ on:
- converted_to_draft

jobs:
operator-lint:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: 'components/operator'

operator-unit-tests:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/serverless-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@ on:
- converted_to_draft

jobs:
serverless-lint:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.SETUP_GO_VERSION }}
- uses: ./.github/actions/setup-libgit2
- uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: 'components/serverless'

serverless-unit-tests:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
Expand Down

0 comments on commit 7cfcf3e

Please sign in to comment.