Skip to content

Commit

Permalink
streamline how github action workflows get triggered (#147)
Browse files Browse the repository at this point in the history
* streamline how github workflow get triggered

* add changes to e2e test sink

* seperate unit test and crd validation
  • Loading branch information
friedrichwilken authored Oct 18, 2023
1 parent 05959b3 commit 4b56b1d
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ env:
on:
pull_request:
branches: [ "main" ]
paths-ignore:
- 'docs/**'
- '**.md'

jobs:
nats:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: golangci-lint
on: [pull_request]

on:
pull_request:
branches: [ "main" ]
paths-ignore:
- 'docs/**'
- '**.md'

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/sink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ on:
paths:
- 'hack/e2e/sink/**'
- '.github/workflows/sink.yml'
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
branches:
- main
paths:
- 'hack/e2e/sink/**'
- '.github/workflows/sink.yml'
paths-ignore:
- 'docs/**'
- '**.md'

jobs:
build:
Expand Down Expand Up @@ -68,7 +74,7 @@ jobs:
org.opencontainers.image.title=E2E Tests Sink
org.opencontainers.image.description=A webserver imitating an eventing sink that receives events and stores in memory
org.opencontainers.image.url=https://github.com/kyma-project/eventing-manager/${{ env.E2E_SINK_DIR }}
- name: Build Docker image
id: build-and-push
uses: docker/build-push-action@v5
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: test

env:
KYMA_STABILITY: "unstable"
KYMA: "./hack/kyma"

on:
push:
branches: [ "main" ]
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
branches: [ "main" ]
paths-ignore:
- 'docs/**'
- '**.md'

jobs:
unit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Sync GO dependencies
run: |
go mod tidy
go mod vendor
- name: Run tests
run: |
make test-only
30 changes: 15 additions & 15 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ env:
on:
push:
branches: [ "main" ]
paths:
- 'api/**'
- 'config/crd/**'
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
branches: [ "main" ]
paths:
- 'api/**'
- 'config/crd/**'
paths-ignore:
- 'docs/**'
- '**.md'

jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Sync GO dependencies
run: |
go mod tidy
go mod vendor
- name: Run tests
run: |
make test-only
validate-crd:
crd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install k3d tools
run: |
make -C hack/ci/ install-k3d-tools
Expand All @@ -38,6 +38,6 @@ jobs:
make -C hack/ci/ create-k3d
kubectl version
kubectl cluster-info
- name: apply crd
run: kubectl apply -f config/crd/bases/operator.kyma-project.io_eventings.yaml

0 comments on commit 4b56b1d

Please sign in to comment.