Skip to content

Commit

Permalink
Run github action workflows on release-branches. (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken authored Dec 14, 2023
1 parent a2c4f3c commit e7a0190
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 74 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ env:

on:
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

jobs:
nats:
Expand Down Expand Up @@ -59,7 +61,7 @@ jobs:
- name: Setup and test the eventing-manager
run: |
make e2e-setup
make e2e-setup
- name: Setup eventing
run: |
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: golangci-lint

on:
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

permissions:
contents: read
Expand All @@ -19,7 +21,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: "1.21"
cache: false
- uses: actions/checkout@v4
- name: golangci-lint
Expand Down
100 changes: 51 additions & 49 deletions .github/workflows/sink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ env:
on:
push:
branches:
- main
tags: [ '*.*.*' ]
- main
- "release-*"
tags: ["*.*.*"]
paths:
- 'hack/e2e/sink/**'
- '.github/workflows/sink.yml'
- "hack/e2e/sink/**"
- ".github/workflows/sink.yml"
pull_request:
branches:
- main
- main
- "release-*"
paths:
- 'hack/e2e/sink/**'
- '.github/workflows/sink.yml'
- "hack/e2e/sink/**"
- ".github/workflows/sink.yml"

jobs:
build:
Expand All @@ -32,51 +34,51 @@ jobs:
working-directory: ${{ env.E2E_SINK_DIR }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19
cache: true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19
cache: true

- name: Build
run: go build -v ./...
- name: Build
run: go build -v ./...

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
# if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
# if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=semver,pattern={{version}},event=tag
labels: |
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: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=semver,pattern={{version}},event=tag
labels: |
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
with:
context: ${{ env.E2E_SINK_DIR }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: ${{ github.event_name == 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: ${{ env.E2E_SINK_DIR }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: ${{ github.event_name == 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
22 changes: 13 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ env:

on:
push:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

jobs:
unit:
Expand All @@ -26,7 +30,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: "1.21"
cache: false
- name: Sync GO dependencies
run: |
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ env:

on:
push:
branches: [ "main" ]
branches:
- main
- "release-*"
paths:
- 'api/**'
- 'config/crd/**'
- "api/**"
- "config/crd/**"
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths:
- 'api/**'
- 'config/crd/**'
- "api/**"
- "config/crd/**"

jobs:
crd:
Expand Down

0 comments on commit e7a0190

Please sign in to comment.