Skip to content

Commit

Permalink
build(github): fix broken github actions and regenerate some code (#615)
Browse files Browse the repository at this point in the history
* build(proto): regenerate .proto files, only whitespace changes

* build(github): check generated code on PRs to v0.x-dev

* chore: regenerate mocks

* chore(github): configure yamllint for github workflows code

* build(github): cleanup conditions when to run jobs

* build(github): rename linter.yml to markdown-linter.yml

* build(github): use super-linter action instead of docker image

* chore: fix linter issue

* build(github): change *.md link checker action

* doc: fix broken links in *.md files
  • Loading branch information
lklimek authored Apr 4, 2023
1 parent ed7ea4f commit af8f620
Show file tree
Hide file tree
Showing 40 changed files with 712 additions and 190 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/.yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: default

rules:
line-length: disable
truthy: disable
comments: {min-spaces-from-content: 1}
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ on:
push:
branches:
- master
- release/**
- v0.*-dev

- v[0-9]+.[0-9]+-dev
jobs:
build:
name: Build
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
name: Check generated code
on:
pull_request:
paths:
- "**.go"
- "**.proto"
push:
branches:
- master
- v[0-9]+.[0-9]+-dev

permissions:
contents: read
Expand All @@ -18,15 +23,15 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: '1.19'
go-version: "1.19"

- uses: actions/checkout@v3

- name: "Check generated mocks"
run: |
set -euo pipefail
readonly MOCKERY=2.12.3 # N.B. no leading "v"
readonly MOCKERY=2.23.1 # N.B. no leading "v"
curl -sL "https://github.com/vektra/mockery/releases/download/v${MOCKERY}/mockery_${MOCKERY}_Linux_x86_64.tar.gz" | tar -C /usr/local/bin -xzf -
make mockery 2>/dev/null
Expand All @@ -44,11 +49,11 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: '1.19'
go-version: "1.19"

- uses: actions/checkout@v3
with:
fetch-depth: 1 # we need a .git directory to run git diff
fetch-depth: 1 # we need a .git directory to run git diff

- name: "Check protobuf generated code"
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ name: e2e
# Runs the CI end-to-end test network on all pushes to master or release
# branches and every pull request, but only if any Go files have been changed.
on:
workflow_dispatch: # allow running workflow manually
workflow_dispatch: # allow running workflow manually
pull_request:
paths:
- "**Dockerfile"
- "**.go"
push:
branches:
- master
- release/**
- v[0-9]+.[0-9]+-dev

jobs:
e2e-test:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ name: Golang Linter

on:
pull_request:
paths:
- "**.go"
push:
branches:
- master
- v[0-9]+.[0-9]+-dev

jobs:
golangci:
name: golangci-lint
Expand All @@ -26,7 +30,7 @@ jobs:
submodules: true
- uses: actions/[email protected]
with:
go-version: '^1.19'
go-version: "^1.19"
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/markdown-links.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
---
name: Check Markdown links

on:
# Temporarily disabled job on PRs. Re-enable when docs are fixed.
# pull_request:
# paths:
# - "**.md"
push:
branches:
- master
pull_request:
branches: [master]
- v[0-9]+.[0-9]+-dev

jobs:
markdown-link-check:
Expand All @@ -16,8 +20,8 @@ jobs:
with:
PATTERNS: |
**/**.md
- uses: creachadair/github-action-markdown-link-check@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
check-modified-files-only: 'yes'
config-file: '.md-link-check.json'
check-modified-files-only: "yes"
config-file: ".md-link-check.json"
if: env.GIT_DIFF
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
name: Markdown Linter
on:
push:
branches:
- master
paths:
- "**.md"
- "**.yml"
- "**.yaml"
pull_request:
branches: [master]
paths:
- "**.md"
- "**.yml"
- "**.yaml"
push:
branches:
- master
- v[0-9]+.[0-9]+-dev

jobs:
build:
Expand All @@ -23,7 +20,7 @@ jobs:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libpcap-dev
- name: Lint Code Base
uses: docker://github/super-linter:v4
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: master
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/proto-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ name: Protobuf Lint
on:
pull_request:
paths:
- 'proto/**'
- "proto/**"
push:
branches:
- master
paths:
- 'proto/**'
- v[0-9]+.[0-9]+-dev

jobs:
lint:
Expand All @@ -18,4 +17,4 @@ jobs:
- uses: bufbuild/[email protected]
- uses: bufbuild/buf-lint-action@v1
with:
input: 'proto'
input: "proto"
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
name: Test
on:
pull_request:
push:
paths:
- "**.go"
push:
branches:
- master
- release/**
- v0.*-dev
- v[0-9].[0-9]+-dev
jobs:
tests:
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit af8f620

Please sign in to comment.