Skip to content

Commit

Permalink
ci: skip netpol e2e automatically for push events (#2379)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Feb 27, 2023
1 parent b8ad117 commit 6321f17
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions .github/workflows/build-x86-image.yaml
Expand Up @@ -169,6 +169,39 @@ jobs:
- run: make e2e-build
working-directory: ${{ env.E2E_DIR }}

netpol-path-filter:
name: Network Policy Path Filter
if: github.event_name != 'pull_request'
runs-on: ubuntu-22.04
outputs:
test-netpol: ${{ steps.filter.outputs.kube-ovn-controller }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
check-latest: true

- name: Generate path filter
run: |
filter=".github/path-filters.yaml"
cat > $filter <<EOF
kube-ovn-controller:
- go.mod
- go.sum
EOF
sh hack/go-list.sh pkg/controller | while read f; do
echo "- $f" | tee -a $filter
done
- uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ github.base_ref || github.ref_name }}
filters: .github/path-filters.yaml
list-files: csv

k8s-conformance-e2e:
name: Kubernetes Conformance E2E
needs:
Expand Down Expand Up @@ -269,10 +302,13 @@ jobs:

k8s-netpol-e2e:
name: Kubernetes Network Policy E2E
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy')
if: |
always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') &&
(needs.netpol-path-filter.outputs.test-netpol == 1 || contains(github.event.pull_request.labels.*.name, 'network policy'))
needs:
- build-kube-ovn
- build-e2e-binaries
- netpol-path-filter
runs-on: ubuntu-22.04
timeout-minutes: 60
strategy:
Expand Down Expand Up @@ -361,8 +397,12 @@ jobs:

cyclonus-netpol-e2e:
name: Cyclonus Network Policy E2E
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'network policy')
needs: build-kube-ovn
if: |
always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') &&
(needs.netpol-path-filter.outputs.test-netpol == 1 || contains(github.event.pull_request.labels.*.name, 'network policy'))
needs:
- build-kube-ovn
- netpol-path-filter
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
Expand Down

0 comments on commit 6321f17

Please sign in to comment.