Skip to content

Commit

Permalink
Merge pull request #1076 from embano1/workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lamw committed Jul 9, 2023
2 parents 1e5cd23 + cb0ddcd commit 2fec7c6
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [main]
branches: [main,master]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
branches: [main,master]
schedule:
- cron: "34 21 * * 5"

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/gcr-dev-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ jobs:
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Setup ko
uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- id: login_to_gcp
uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033
with:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/gcr-prerelease-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ jobs:
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Setup ko
uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- id: login_to_gcp
uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033
with:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum

- name: Create CHANGELOG for Release
env:
Expand All @@ -46,7 +47,7 @@ jobs:
- name: GoReleaser
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7
with:
args: release --rm-dist --release-notes RELEASE_CHANGELOG.md
args: release --clean --release-notes RELEASE_CHANGELOG.md
workdir: vmware-event-router
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -111,17 +112,18 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Setup ko
uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- id: login_to_gcp
uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033
with:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/router-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,21 @@ jobs:
timeout-minutes: 20

steps:
- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: GoReleaser Snapshot
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7
with:
version: latest
args: release --rm-dist --snapshot
args: release --clean --snapshot
workdir: vmware-event-router
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -52,7 +53,7 @@ jobs:
with:
name: dist
path: |
vmware-event-router/dist/router_Linux_*.tar.gz
vmware-event-router/dist/router_linux_*.tar.gz
vmware-event-router/dist/checksums.txt
retention-days: 1

Expand All @@ -69,18 +70,19 @@ jobs:
KO_DOCKER_REPO: us.gcr.io/daisy-284300/veba # .../router@sha256:

steps:
- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Setup ko
uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Get short COMMIT and TAG
run: |
echo "KO_COMMIT=$(echo -n $GITHUB_SHA | cut -c -8)" >> $GITHUB_ENV
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/router-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@ jobs:
timeout-minutes: 15

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Set up Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: 1.19
cache-dependency-path: vmware-event-router/go.sum

- name: Setup ko
uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6

- name: Check out code onto GOPATH
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
fetch-depth: 1

- name: Get short COMMIT and TAG (used by ko)
run: |
echo "KO_COMMIT=$(echo -n $GITHUB_SHA | cut -c -8)" >> $GITHUB_ENV
Expand Down Expand Up @@ -135,19 +133,17 @@ jobs:
timeout-minutes: 15

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Set up Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: 1.19
cache-dependency-path: vmware-event-router/go.sum

- name: Setup ko
uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6

- name: Check out code onto GOPATH
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
fetch-depth: 1

- name: Get short COMMIT and TAG (used by ko)
run: |
echo "KO_COMMIT=$(echo -n $GITHUB_SHA | cut -c -8)" >> $GITHUB_ENV
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/router-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
timeout-minutes: 20

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Install tparse
run: go install github.com/mfridman/tparse@latest

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/router-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ jobs:
timeout-minutes: 20

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache: false # use golangci-lint caching
id: go

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: golangci-lint
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299
with:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/router-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ jobs:
timeout-minutes: 10

steps:
- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: vmware-event-router/go.sum
id: go

- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Install tparse
run: go install github.com/mfridman/tparse@latest

Expand Down
10 changes: 1 addition & 9 deletions vmware-event-router/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
linters-settings:
depguard:
list-type: blacklist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/sirupsen/logrus
packages-with-error-message:
- github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
dupl:
threshold: 100
funlen:
Expand Down Expand Up @@ -65,7 +57,7 @@ linters:
enable:
- bodyclose
# - deadcode
- depguard
# - depguard
- dogsled
- dupl
- errcheck
Expand Down
5 changes: 0 additions & 5 deletions vmware-event-router/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ archives:
builds:
- router
name_template: "router_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
replacements: &replacements
darwin: Darwin
linux: Linux
windows: Windows
amd64: x86_64
format_overrides:
- goos: windows
format: zip
Expand Down

0 comments on commit 2fec7c6

Please sign in to comment.