Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: Skip jobs instead of workflows #16487

Merged
merged 1 commit into from Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 25 additions & 17 deletions .github/workflows/documentation.yaml
Expand Up @@ -2,33 +2,41 @@ name: Documentation Updates

# Any change in triggers needs to be reflected in the concurrency group.
on:
pull_request:
paths:
- 'Documentation/**'
- 'bugtool/cmd/**'
- 'cilium/cmd/**'
- 'cilium-health/cmd/**'
- 'daemon/cmd/**'
- 'hubble-relay/cmd/**'
- 'operator/cmd/**'
pull_request: {}
push:
branches:
- master
paths:
- 'Documentation/**'
- 'bugtool/cmd/**'
- 'cilium/cmd/**'
- 'cilium-health/cmd/**'
- 'daemon/cmd/**'
- 'hubble-relay/cmd/**'
- 'operator/cmd/**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
cancel-in-progress: true

jobs:
check_changes:
name: Deduce required tests from code changes
runs-on: ubuntu-18.04
outputs:
docs-tree: ${{ steps.docs-tree.outputs.src }}
steps:
- name: Check code changes
uses: dorny/paths-filter@78ab00f87740f82aec8ed8826eb4c3c851044126
id: docs-tree
with:
filters: |
src:
- 'Documentation/**'
- 'bugtool/cmd/**'
- 'cilium/cmd/**'
- 'cilium-health/cmd/**'
- 'daemon/cmd/**'
- 'hubble-relay/cmd/**'
- 'operator/cmd/**'

# Runs only if code under Documentation or */cmd/ is changed as the docs
# should be unaffected otherwise.
build-html:
needs: check_changes
if: ${{ needs.check_changes.outputs.docs-tree == 'true' }}
name: Validate & Build HTML
runs-on: ubuntu-18.04
steps:
Expand Down
31 changes: 20 additions & 11 deletions .github/workflows/lint-codeql.yaml
@@ -1,22 +1,31 @@
name: codeql

on:
push:
paths:
- '*.go'
- 'go.mod'
- 'go.sum'
pull_request:
paths:
- '*.go'
- 'go.mod'
- 'go.sum'
push: {}
pull_request: {}
schedule:
- cron: "45 6 * * 3"

jobs:
check_changes:
name: Deduce required tests from code changes
runs-on: ubuntu-18.04
outputs:
go-changes: ${{ steps.go-changes.outputs.src }}
steps:
- name: Check code changes
uses: dorny/paths-filter@78ab00f87740f82aec8ed8826eb4c3c851044126
id: go-changes
with:
filters: |
src:
- '*.go'
- 'go.mod'
- 'go.sum'

analyze:
if: github.repository == 'cilium/cilium'
needs: check_changes
if: github.repository == 'cilium/cilium' && needs.check_changes.outputs.go-changes == 'true'
runs-on: ubuntu-18.04
steps:
- name: Checkout repo
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/tests-smoke-ipv6.yaml
Expand Up @@ -2,16 +2,10 @@ name: Smoke Test with IPv6

# Any change in triggers needs to be reflected in the concurrency group.
on:
pull_request:
paths-ignore:
- 'Documentation/**'
- 'test/**'
pull_request: {}
push:
branches:
- master
paths-ignore:
- 'Documentation/**'
- 'test/**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
Expand All @@ -26,8 +20,23 @@ env:
LOG_TIME: 30m

jobs:
check_changes:
name: Deduce required tests from code changes
runs-on: ubuntu-18.04
outputs:
tested: ${{ steps.tested-tree.outputs.src }}
steps:
- name: Check code changes
uses: dorny/paths-filter@78ab00f87740f82aec8ed8826eb4c3c851044126
id: tested-tree
with:
filters: |
src:
- '!(test|Documentation)/**'

conformance-test-ipv6:
if: ${{ github.repository == 'cilium/cilium' }}
needs: check_changes
if: ${{ github.repository == 'cilium/cilium' && needs.check_changes.outputs.tested == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/tests-smoke.yaml
Expand Up @@ -2,16 +2,10 @@ name: Smoke test

# Any change in triggers needs to be reflected in the concurrency group.
on:
pull_request:
paths-ignore:
- 'Documentation/**'
- 'test/**'
pull_request: {}
push:
branches:
- master
paths-ignore:
- 'Documentation/**'
- 'test/**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
Expand All @@ -25,6 +19,20 @@ env:
LOG_TIME: 30m

jobs:
check_changes:
name: Deduce required tests from code changes
runs-on: ubuntu-18.04
outputs:
tested: ${{ steps.tested-tree.outputs.src }}
steps:
- name: Check code changes
uses: dorny/paths-filter@78ab00f87740f82aec8ed8826eb4c3c851044126
id: tested-tree
with:
filters: |
src:
- '!(test|Documentation)/**'

preflight-clusterrole:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -69,7 +77,8 @@ jobs:
git diff --exit-code || (echo "please run 'make -C install/kubernetes docs' and submit your changes"; exit 1)

conformance-test:
if: ${{ github.repository == 'cilium/cilium' }}
needs: check_changes
if: ${{ github.repository == 'cilium/cilium' && needs.check_changes.outputs.tested == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down