From 1b17d3b9e2d9171052ec5e48a28cfda740ee642b Mon Sep 17 00:00:00 2001 From: Gerhard Lazu Date: Thu, 27 Jan 2022 13:22:38 +0000 Subject: [PATCH 1/2] Do not run lint & tests on unrelated file changes These paths shouldn't trigger lint or test runs. Signed-off-by: Gerhard Lazu --- .github/workflows/lint.yml | 22 ++++++++++++++++++++++ .github/workflows/test-docs.yml | 22 ++++++++++++++++++++++ .github/workflows/test-integration.yml | 24 ++++++++++++++++++++++++ .github/workflows/test-unit.yml | 24 ++++++++++++++++++++++++ .github/workflows/test-universe.yml | 24 ++++++++++++++++++++++++ 5 files changed, 116 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9792b33e..ea21fa21 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,8 +3,30 @@ name: Lint on: push: branches: [main] + ignore-paths: + - 'docs/**' + - 'infra/**' + - 'website/**' + - '.gitignore' + - '.golangci.yml' + - '.goreleaser.yml' + - 'Dockerfile' + - 'install.ps1' + - 'semver' + - 'tracing.compose.yaml' pull_request: branches: [main] + ignore-paths: + - 'docs/**' + - 'infra/**' + - 'website/**' + - '.gitignore' + - '.golangci.yml' + - '.goreleaser.yml' + - 'Dockerfile' + - 'install.ps1' + - 'semver' + - 'tracing.compose.yaml' jobs: everything: diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index 7153405a..923a4320 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -3,8 +3,30 @@ name: "Test Docs" on: push: branches: [main] + ignore-paths: + - 'infra/**' + - 'website/**' + - '.gitignore' + - '.golangci.yml' + - '.goreleaser.yml' + - 'Dockerfile' + - 'README.md' + - 'install.ps1' + - 'semver' + - 'tracing.compose.yaml' pull_request: branches: [main] + ignore-paths: + - 'infra/**' + - 'website/**' + - '.gitignore' + - '.golangci.yml' + - '.goreleaser.yml' + - 'Dockerfile' + - 'README.md' + - 'install.ps1' + - 'semver' + - 'tracing.compose.yaml' jobs: docs: diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 3e800b46..1981eb99 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -3,8 +3,32 @@ name: "Test Integration" on: push: branches: [main] + ignore-paths: + - 'docs/**' + - 'infra/**' + - 'website/**' + - '.gitignore' + - '.golangci.yml' + - '.goreleaser.yml' + - 'Dockerfile' + - 'README.md' + - 'install.ps1' + - 'semver' + - 'tracing.compose.yaml' pull_request: branches: [main] + ignore-paths: + - 'docs/**' + - 'infra/**' + - 'website/**' + - '.gitignore' + - '.golangci.yml' + - '.goreleaser.yml' + - 'Dockerfile' + - 'README.md' + - 'install.ps1' + - 'semver' + - 'tracing.compose.yaml' jobs: integration: diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 4dc9f06e..30f555b4 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -3,8 +3,32 @@ name: "Test Unit" on: push: branches: [main] + ignore-paths: + - 'docs/**' + - 'infra/**' + - 'website/**' + - '.gitignore' + - '.golangci.yml' + - '.goreleaser.yml' + - 'Dockerfile' + - 'README.md' + - 'install.ps1' + - 'semver' + - 'tracing.compose.yaml' pull_request: branches: [main] + ignore-paths: + - 'docs/**' + - 'infra/**' + - 'website/**' + - '.gitignore' + - '.golangci.yml' + - '.goreleaser.yml' + - 'Dockerfile' + - 'README.md' + - 'install.ps1' + - 'semver' + - 'tracing.compose.yaml' jobs: unit: diff --git a/.github/workflows/test-universe.yml b/.github/workflows/test-universe.yml index 25abb177..0a8335f2 100644 --- a/.github/workflows/test-universe.yml +++ b/.github/workflows/test-universe.yml @@ -3,8 +3,32 @@ name: "Test Universe" on: push: branches: [main] + ignore-paths: + - 'docs/**' + - 'infra/**' + - 'website/**' + - '.gitignore' + - '.golangci.yml' + - '.goreleaser.yml' + - 'Dockerfile' + - 'README.md' + - 'install.ps1' + - 'semver' + - 'tracing.compose.yaml' pull_request: branches: [main] + ignore-paths: + - 'docs/**' + - 'infra/**' + - 'website/**' + - '.gitignore' + - '.golangci.yml' + - '.goreleaser.yml' + - 'Dockerfile' + - 'README.md' + - 'install.ps1' + - 'semver' + - 'tracing.compose.yaml' jobs: universe: From bcd175e5ebc92d20e766f1eaf9725e91863060cc Mon Sep 17 00:00:00 2001 From: Gerhard Lazu Date: Fri, 4 Feb 2022 12:18:21 +0000 Subject: [PATCH 2/2] Use paths instead of paths-ignore for trigerring actions Andrea made some great suggestions, thanks! Signed-off-by: Gerhard Lazu --- .github/workflows/lint.yml | 34 ++++++++++----------- .github/workflows/test-docs.yml | 34 ++++++++------------- .github/workflows/test-integration.yml | 42 +++++++++++--------------- .github/workflows/test-unit.yml | 36 ++++++++-------------- .github/workflows/test-universe.yml | 42 +++++++++++--------------- 5 files changed, 76 insertions(+), 112 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ea21fa21..8dbe1c81 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,30 +3,28 @@ name: Lint on: push: branches: [main] - ignore-paths: + paths: + - '**.go' + - '**.sh' + - '**.bash' + - '**.cue' - 'docs/**' - - 'infra/**' - - 'website/**' - - '.gitignore' - '.golangci.yml' - - '.goreleaser.yml' - - 'Dockerfile' - - 'install.ps1' - - 'semver' - - 'tracing.compose.yaml' + - 'Makefile' + - 'README.md' + - '.github/workflows/lint.yml' pull_request: branches: [main] - ignore-paths: + paths: + - '**.go' + - '**.sh' + - '**.bash' + - '**.cue' - 'docs/**' - - 'infra/**' - - 'website/**' - - '.gitignore' - '.golangci.yml' - - '.goreleaser.yml' - - 'Dockerfile' - - 'install.ps1' - - 'semver' - - 'tracing.compose.yaml' + - 'Makefile' + - 'README.md' + - '.github/workflows/lint.yml' jobs: everything: diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index 923a4320..7b92576e 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -3,30 +3,20 @@ name: "Test Docs" on: push: branches: [main] - ignore-paths: - - 'infra/**' - - 'website/**' - - '.gitignore' - - '.golangci.yml' - - '.goreleaser.yml' - - 'Dockerfile' - - 'README.md' - - 'install.ps1' - - 'semver' - - 'tracing.compose.yaml' + paths: + - '**.go' + - '**.cue' + - 'docs/**' + - 'Makefile' + - '.github/workflows/test-docs.yml' pull_request: branches: [main] - ignore-paths: - - 'infra/**' - - 'website/**' - - '.gitignore' - - '.golangci.yml' - - '.goreleaser.yml' - - 'Dockerfile' - - 'README.md' - - 'install.ps1' - - 'semver' - - 'tracing.compose.yaml' + paths: + - '**.go' + - '**.cue' + - 'docs/**' + - 'Makefile' + - '.github/workflows/test-docs.yml' jobs: docs: diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 1981eb99..b876945c 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -3,32 +3,26 @@ name: "Test Integration" on: push: branches: [main] - ignore-paths: - - 'docs/**' - - 'infra/**' - - 'website/**' - - '.gitignore' - - '.golangci.yml' - - '.goreleaser.yml' - - 'Dockerfile' - - 'README.md' - - 'install.ps1' - - 'semver' - - 'tracing.compose.yaml' + paths: + - '**.sh' + - '**.bash' + - '**.go' + - '**.cue' + - 'Makefile' + - 'go.mod' + - 'go.sum' + - '.github/workflows/test-integration.yml' pull_request: branches: [main] - ignore-paths: - - 'docs/**' - - 'infra/**' - - 'website/**' - - '.gitignore' - - '.golangci.yml' - - '.goreleaser.yml' - - 'Dockerfile' - - 'README.md' - - 'install.ps1' - - 'semver' - - 'tracing.compose.yaml' + paths: + - '**.sh' + - '**.bash' + - '**.go' + - '**.cue' + - 'Makefile' + - 'go.mod' + - 'go.sum' + - '.github/workflows/test-integration.yml' jobs: integration: diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 30f555b4..2cba616b 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -3,32 +3,20 @@ name: "Test Unit" on: push: branches: [main] - ignore-paths: - - 'docs/**' - - 'infra/**' - - 'website/**' - - '.gitignore' - - '.golangci.yml' - - '.goreleaser.yml' - - 'Dockerfile' - - 'README.md' - - 'install.ps1' - - 'semver' - - 'tracing.compose.yaml' + paths: + - '**.go' + - 'Makefile' + - 'go.mod' + - 'go.sum' + - '.github/workflows/test-unit.yml' pull_request: branches: [main] - ignore-paths: - - 'docs/**' - - 'infra/**' - - 'website/**' - - '.gitignore' - - '.golangci.yml' - - '.goreleaser.yml' - - 'Dockerfile' - - 'README.md' - - 'install.ps1' - - 'semver' - - 'tracing.compose.yaml' + paths: + - '**.go' + - 'Makefile' + - 'go.mod' + - 'go.sum' + - '.github/workflows/test-unit.yml' jobs: unit: diff --git a/.github/workflows/test-universe.yml b/.github/workflows/test-universe.yml index 0a8335f2..3ae36318 100644 --- a/.github/workflows/test-universe.yml +++ b/.github/workflows/test-universe.yml @@ -3,32 +3,26 @@ name: "Test Universe" on: push: branches: [main] - ignore-paths: - - 'docs/**' - - 'infra/**' - - 'website/**' - - '.gitignore' - - '.golangci.yml' - - '.goreleaser.yml' - - 'Dockerfile' - - 'README.md' - - 'install.ps1' - - 'semver' - - 'tracing.compose.yaml' + paths: + - '**.sh' + - '**.bash' + - '**.go' + - '**.cue' + - 'Makefile' + - 'go.mod' + - 'go.sum' + - '.github/workflows/test-universe.yml' pull_request: branches: [main] - ignore-paths: - - 'docs/**' - - 'infra/**' - - 'website/**' - - '.gitignore' - - '.golangci.yml' - - '.goreleaser.yml' - - 'Dockerfile' - - 'README.md' - - 'install.ps1' - - 'semver' - - 'tracing.compose.yaml' + paths: + - '**.sh' + - '**.bash' + - '**.go' + - '**.cue' + - 'Makefile' + - 'go.mod' + - 'go.sum' + - '.github/workflows/test-universe.yml' jobs: universe: