Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: separates out style checks from tests #230

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Style
on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
style:
if: github.event_name == 'pull_request' || github.event_name == 'push'
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
cache: false
go-version-file: go.mod
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/.cache/golangci-lint
~/go/pkg/mod
~/go/bin
key: code-style-check-${{ hashFiles('**/go.mod', '**/go.sum', '**/Makefile') }}
- name: Run code style check
run: make check
35 changes: 12 additions & 23 deletions .github/workflows/commit.yaml → .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
name: Commit
name: Tests
on:
pull_request:
branches:
- main
paths-ignore:
- '**/*.md'
- 'site/**'
- 'netlify.toml'

push:
branches:
- main
paths-ignore:
- '**/*.md'
- 'site/**'
- 'netlify.toml'

# If the PR is coming from a fork, they are not allowed to access secrets by default.
# This even is triggered only if the PR gets labeled with 'safe to test' which can only be added by the maintainers.
# Jobs do not use secrets in the workflow will ignore this event.
Expand All @@ -20,27 +30,6 @@ concurrency:
cancel-in-progress: true

jobs:
style:
if: github.event_name == 'pull_request' || github.event_name == 'push'
name: Code Style Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
cache: false
go-version-file: go.mod
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/.cache/golangci-lint
~/go/pkg/mod
~/go/bin
key: code-style-check-${{ hashFiles('**/go.mod', '**/go.sum', '**/Makefile') }}
- name: Run code style check
run: make check

unittest:
if: github.event_name == 'pull_request' || github.event_name == 'push'
name: Unit Test
Expand Down Expand Up @@ -193,7 +182,7 @@ jobs:
# Docker builds are verified in test_e2e job, so we only need to push the images when the event is a push event.
if: github.event_name == 'push'
name: Push Docker Images
needs: [style, unittest, test_cel_validation, test_controller, test_extproc, test_e2e]
needs: [unittest, test_cel_validation, test_controller, test_extproc, test_e2e]
uses: ./.github/workflows/docker_builds_template.yaml

push_helm:
Expand Down
Loading