Skip to content

Commit

Permalink
Cancel redundant pipelines and remove redundant build jobs (#1524)
Browse files Browse the repository at this point in the history
  • Loading branch information
ciarams87 committed Apr 9, 2021
1 parent 082d957 commit 47beffc
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 259 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/cancel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Cancel
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
- 'docs-web/**'
- 'examples/**'
- 'examples-of-custom-resources/**'
- '**.md'
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
- 'docs-web/**'
- 'examples/**'
- 'examples-of-custom-resources/**'
- '**.md'
types:
- opened
- reopened
- synchronize

jobs:
cancel:
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/cancel-workflow-action@0.8.0
with:
workflow_id: 2012221,5339701,7611535
access_token: ${{ secrets.GITHUB_TOKEN }}
133 changes: 2 additions & 131 deletions .github/workflows/edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,139 +89,10 @@ jobs:
- name: Run Tests
run: go test ./...

build:
name: Build Docker Images
runs-on: ${{ matrix.os }}
needs: [binary, unit-tests]
if:
github.event.pull_request.head.repo.full_name == 'nginxinc/kubernetes-ingress' ||
github.event_name == 'push'
strategy:
matrix:
include:
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: debian
type: oss
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: alpine
type: oss
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: debian-plus
type: plus
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: opentracing
type: oss
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: opentracing-plus
type: plus
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: openshift
type: oss
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: openshift-plus
type: plus
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: debian-plus-ap
type: plus-ap
- os: ubuntu-20.04
file: build/DockerfileWithAppProtectForPlusForOpenShift
context: '.'
target: local
image: nginx-plus-ingress-ap-openshift
type: plus-ap-openshift
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Fetch Cached Artifacts
uses: actions/cache@v2.1.4
with:
path: ${{ github.workspace }}/nginx-ingress
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }}
- name: Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host
- name: Cache Docker layers
uses: actions/cache@v2.1.4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Docker Image ${{ matrix.image }}
uses: docker/build-push-action@v2
with:
file: ${{ matrix.file }}
context: ${{ matrix.context }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
target: ${{ matrix.target }}
tags: ${{ matrix.image }}:${{ github.sha }}
build-args: |
BUILD_OS=${{ matrix.image }}
if: matrix.type == 'oss'
- name: Build Plus Docker Image ${{ matrix.image }}
uses: docker/build-push-action@v2
with:
file: ${{ matrix.file }}
context: ${{ matrix.context }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
target: ${{ matrix.target }}
tags: ${{ matrix.image }}:${{ github.sha }}
secrets: |
"nginx-repo.crt=${{ secrets.KIC_NGINX_CRT }}"
"nginx-repo.key=${{ secrets.KIC_NGINX_KEY }}"
build-args: |
BUILD_OS=${{ matrix.image }}
PLUS=-plus
if: matrix.type == 'plus'
- name: Build AP Docker Image ${{ matrix.image }}
uses: docker/build-push-action@v2
with:
file: ${{ matrix.file }}
context: ${{ matrix.context }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
target: ${{ matrix.target }}
tags: ${{ matrix.image }}:${{ github.sha }}
secrets: |
"nginx-repo.crt=${{ secrets.KIC_NGINX_AP_CRT }}"
"nginx-repo.key=${{ secrets.KIC_NGINX_AP_KEY }}"
"rhel_license=${{ secrets.KIC_RHEL_LICENSE }}"
build-args: |
BUILD_OS=${{ matrix.image }}
PLUS=-plus
if: matrix.type == 'plus-ap' || matrix.type == 'plus-ap-openshift'

smoke-tests:
name: Smoke Tests
runs-on: ${{ matrix.os }}
needs: [build, binary, unit-tests]
needs: [binary, unit-tests]
if:
github.event.pull_request.head.repo.full_name == 'nginxinc/kubernetes-ingress' ||
github.event_name == 'push'
Expand Down Expand Up @@ -405,7 +276,7 @@ jobs:
helm-tests:
name: Helm Tests
runs-on: ${{ matrix.os }}
needs: [build, binary, unit-tests]
needs: [binary, unit-tests]
env:
NGINX_HTTP_PORT: 8080
NGINX_HTTPS_PORT: 8443
Expand Down
130 changes: 2 additions & 128 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,136 +62,10 @@ jobs:
- name: Run Tests
run: go test ./...

build:
name: Build Docker Images
runs-on: ${{ matrix.os }}
needs: [binary, unit-tests]
strategy:
matrix:
include:
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: debian
type: oss
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: alpine
type: oss
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: debian-plus
type: plus
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: opentracing
type: oss
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: opentracing-plus
type: plus
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: openshift
type: oss
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: openshift-plus
type: plus
- os: ubuntu-20.04
file: build/Dockerfile
context: '.'
target: local
image: debian-plus-ap
type: plus-ap
- os: ubuntu-20.04
file: build/DockerfileWithAppProtectForPlusForOpenShift
context: '.'
target: local
image: nginx-plus-ingress-ap-openshift
type: plus-ap-openshift
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Fetch Cached Artifacts
uses: actions/cache@v2.1.4
with:
path: ${{ github.workspace }}/nginx-ingress
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }}
- name: Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host
- name: Cache Docker layers
uses: actions/cache@v2.1.4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Docker Image ${{ matrix.image }}
uses: docker/build-push-action@v2
with:
file: ${{ matrix.file }}
context: ${{ matrix.context }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
target: ${{ matrix.target }}
tags: ${{ matrix.image }}:${{ github.sha }}
build-args: |
BUILD_OS=${{ matrix.image }}
if: matrix.type == 'oss'
- name: Build Plus Docker Image ${{ matrix.image }}
uses: docker/build-push-action@v2
with:
file: ${{ matrix.file }}
context: ${{ matrix.context }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
target: ${{ matrix.target }}
tags: ${{ matrix.image }}:${{ github.sha }}
secrets: |
"nginx-repo.crt=${{ secrets.KIC_NGINX_CRT }}"
"nginx-repo.key=${{ secrets.KIC_NGINX_KEY }}"
build-args: |
BUILD_OS=${{ matrix.image }}
PLUS=-plus
if: matrix.type == 'plus'
- name: Build AP Docker Image ${{ matrix.image }}
uses: docker/build-push-action@v2
with:
file: ${{ matrix.file }}
context: ${{ matrix.context }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
target: ${{ matrix.target }}
tags: ${{ matrix.image }}:${{ github.sha }}
secrets: |
"nginx-repo.crt=${{ secrets.KIC_NGINX_AP_CRT }}"
"nginx-repo.key=${{ secrets.KIC_NGINX_AP_KEY }}"
"rhel_license=${{ secrets.KIC_RHEL_LICENSE }}"
build-args: |
BUILD_OS=${{ matrix.image }}
PLUS=-plus
if: matrix.type == 'plus-ap' || matrix.type == 'plus-ap-openshift'

smoke-tests:
name: Smoke Tests
runs-on: ${{ matrix.os }}
needs: [build, binary, unit-tests]
needs: [binary, unit-tests]
strategy:
matrix:
include:
Expand Down Expand Up @@ -408,7 +282,7 @@ jobs:
helm-tests:
name: Helm Tests
runs-on: ${{ matrix.os }}
needs: [build, binary, unit-tests]
needs: [binary, unit-tests]
env:
NGINX_HTTP_PORT: 8080
NGINX_HTTPS_PORT: 8443
Expand Down

0 comments on commit 47beffc

Please sign in to comment.