forked from github/multus-cni
Update github actions CI pipeline including lint error fix
This commit is contained in:
24
.github/workflows/build.yml
vendored
Normal file
24
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
on: [push, pull_request]
|
||||
name: Build
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.15.x, 1.16.x]
|
||||
goarch: [386, amd64, arm, arm64, ppc64le, s390x]
|
||||
os: [ubuntu-latest] #, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
GOOS: ${{ matrix.goos }}
|
||||
run: ./hack/build-go.sh
|
72
.github/workflows/docker-build-push-master.yml
vendored
72
.github/workflows/docker-build-push-master.yml
vendored
@@ -1,72 +0,0 @@
|
||||
name: Docker-build-push-latest
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
build:
|
||||
name: Docker build
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||
GO111MODULE: on
|
||||
TARGET: amd64
|
||||
REPOSITORY: nfvpe/multus
|
||||
REPOSITORY_USER: nfvperobot
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build latest-amd64
|
||||
run: docker build -t ${REPOSITORY}:latest-amd64 -f deployments/Dockerfile .
|
||||
|
||||
- name: Build latest-ppc64le
|
||||
run: docker build -t ${REPOSITORY}:latest-ppc64le -f deployments/Dockerfile.ppc64le .
|
||||
|
||||
- name: Build latest-arm64v8
|
||||
run: docker build -t ${REPOSITORY}:latest-arm64v8 -f deployments/Dockerfile.arm64 .
|
||||
|
||||
- name: Build latest-s390x
|
||||
run: docker build -t ${REPOSITORY}:latest-s390x -f deployments/Dockerfile.s390x .
|
||||
|
||||
- name: Build latest-origin
|
||||
run: docker build -t ${REPOSITORY}:latest-origin -f deployments/Dockerfile.openshift .
|
||||
|
||||
- name: Tag snapshot
|
||||
run: |
|
||||
docker tag ${REPOSITORY}:latest-amd64 ${REPOSITORY}:snapshot-amd64
|
||||
docker tag ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:snapshot-ppc64le
|
||||
docker tag ${REPOSITORY}:latest-arm64v8 ${REPOSITORY}:snapshot-arm64v8
|
||||
docker tag ${REPOSITORY}:latest-s390x ${REPOSITORY}:snapshot-s390x
|
||||
|
||||
- name: Login to registry
|
||||
if: github.repository == 'intel/multus-cni'
|
||||
run: docker login -u ${REPOSITORY_USER} -p ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Push latest/snapshot images
|
||||
if: github.repository == 'intel/multus-cni'
|
||||
run: |
|
||||
docker push ${REPOSITORY}:latest-amd64
|
||||
docker push ${REPOSITORY}:latest-ppc64le
|
||||
docker push ${REPOSITORY}:latest-arm64v8
|
||||
docker push ${REPOSITORY}:latest-s390x
|
||||
docker push ${REPOSITORY}:snapshot-amd64
|
||||
docker push ${REPOSITORY}:snapshot-ppc64le
|
||||
docker push ${REPOSITORY}:snapshot-arm64v8
|
||||
docker push ${REPOSITORY}:snapshot-s390x
|
||||
|
||||
- name: Create manifest for multi-arch images
|
||||
if: github.repository == 'intel/multus-cni'
|
||||
run: |
|
||||
docker manifest create ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-amd64 ${REPOSITORY}:snapshot-ppc64le ${REPOSITORY}:snapshot-arm64v8 ${REPOSITORY}:snapshot-s390x
|
||||
docker manifest annotate ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-amd64 --arch amd64
|
||||
docker manifest annotate ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-ppc64le --arch ppc64le
|
||||
docker manifest annotate ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-arm64v8 --arch arm64
|
||||
docker manifest annotate ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-s390x --arch s390x
|
||||
docker manifest push ${REPOSITORY}:snapshot
|
||||
docker manifest create ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:latest-arm64v8 ${REPOSITORY}:latest-s390x
|
||||
docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 --arch amd64
|
||||
docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-ppc64le --arch ppc64le
|
||||
docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-arm64v8 --arch arm64
|
||||
docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-s390x --arch s390x
|
||||
docker manifest push ${REPOSITORY}:latest
|
86
.github/workflows/docker-build-push-release.yml
vendored
86
.github/workflows/docker-build-push-release.yml
vendored
@@ -1,86 +0,0 @@
|
||||
name: Docker-build-push-stable
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
jobs:
|
||||
build:
|
||||
name: Docker build
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||
GO111MODULE: on
|
||||
TARGET: amd64
|
||||
REPOSITORY: nfvpe/multus
|
||||
REPOSITORY_USER: nfvperobot
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build latest-amd64
|
||||
run: docker build -t ${REPOSITORY}:latest-amd64 -f deployments/Dockerfile .
|
||||
|
||||
- name: Build latest-ppc64le
|
||||
run: docker build -t ${REPOSITORY}:latest-ppc64le -f deployments/Dockerfile.ppc64le .
|
||||
|
||||
- name: Build latest-arm64v8
|
||||
run: docker build -t ${REPOSITORY}:latest-arm64v8 -f deployments/Dockerfile.arm64 .
|
||||
|
||||
- name: Build latest-s390x
|
||||
run: docker build -t ${REPOSITORY}:latest-s390x -f deployments/Dockerfile.s390x .
|
||||
|
||||
- name: Build latest-origin
|
||||
run: docker build -t ${REPOSITORY}:latest-origin -f deployments/Dockerfile.openshift .
|
||||
|
||||
- name: Tag stable
|
||||
run: |
|
||||
docker tag ${REPOSITORY}:latest-amd64 ${REPOSITORY}:stable-amd64
|
||||
docker tag ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:stable-ppc64le
|
||||
docker tag ${REPOSITORY}:latest-arm64v8 ${REPOSITORY}:stable-arm64v8
|
||||
docker tag ${REPOSITORY}:latest-s390x ${REPOSITORY}:stable-s390x
|
||||
docker tag ${REPOSITORY}:latest-amd64 ${REPOSITORY}:${GITHUB_REF##*/}-amd64
|
||||
docker tag ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le
|
||||
docker tag ${REPOSITORY}:latest-arm64v8 ${REPOSITORY}:${GITHUB_REF##*/}-arm64v8
|
||||
docker tag ${REPOSITORY}:latest-s390x ${REPOSITORY}:${GITHUB_REF##*/}-s390x
|
||||
|
||||
- name: Login to registry
|
||||
if: github.repository == 'intel/multus-cni'
|
||||
run: docker login -u ${REPOSITORY_USER} -p ${{ secrets. REPOSITORY_PASS }}
|
||||
|
||||
- name: Push latest/snapshot images
|
||||
if: github.repository == 'intel/multus-cni'
|
||||
run: |
|
||||
docker push ${REPOSITORY}:latest-amd64
|
||||
docker push ${REPOSITORY}:latest-ppc64le
|
||||
docker push ${REPOSITORY}:latest-arm64v8
|
||||
docker push ${REPOSITORY}:latest-s390x
|
||||
docker push ${REPOSITORY}:stable-amd64
|
||||
docker push ${REPOSITORY}:stable-ppc64le
|
||||
docker push ${REPOSITORY}:stable-arm64v8
|
||||
docker push ${REPOSITORY}:stable-s390x
|
||||
docker push ${REPOSITORY}:${GITHUB_REF##*/}-amd64
|
||||
docker push ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le
|
||||
docker push ${REPOSITORY}:${GITHUB_REF##*/}-arm64v8
|
||||
docker push ${REPOSITORY}:${GITHUB_REF##*/}-s390x
|
||||
|
||||
- name: Create manifest for multi-arch images
|
||||
if: github.repository == 'intel/multus-cni'
|
||||
run: |
|
||||
docker manifest create ${REPOSITORY}:stable ${REPOSITORY}:stable-amd64 ${REPOSITORY}:stable-ppc64le ${REPOSITORY}:stable-arm64v8 ${REPOSITORY}:stable-s390x
|
||||
docker manifest annotate ${REPOSITORY}:stable ${REPOSITORY}:stable-amd64 --arch amd64
|
||||
docker manifest annotate ${REPOSITORY}:stable ${REPOSITORY}:stable-ppc64le --arch ppc64le
|
||||
docker manifest annotate ${REPOSITORY}:stable ${REPOSITORY}:stable-arm64v8 --arch arm64
|
||||
docker manifest annotate ${REPOSITORY}:stable ${REPOSITORY}:stable-s390x --arch s390x
|
||||
docker manifest push ${REPOSITORY}:stable
|
||||
docker manifest create ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 ${REPOSITORY}:latest-ppc64le ${REPOSITORY}:latest-arm64v8 ${REPOSITORY}:latest-s390x
|
||||
docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 --arch amd64
|
||||
docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-ppc64le --arch ppc64le
|
||||
docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-arm64v8 --arch arm64
|
||||
docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-s390x --arch s390x
|
||||
docker manifest push ${REPOSITORY}:latest
|
||||
docker manifest create ${REPOSITORY}:${GITHUB_REF##*/} ${REPOSITORY}:${GITHUB_REF##*/}-amd64 ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le ${REPOSITORY}:${GITHUB_REF##*/}-arm64v8 ${REPOSITORY}:${GITHUB_REF##*/}-s390x
|
||||
docker manifest annotate ${REPOSITORY}:${GITHUB_REF##*/} ${REPOSITORY}:${GITHUB_REF##*/}-amd64 --arch amd64
|
||||
docker manifest annotate ${REPOSITORY}:${GITHUB_REF##*/} ${REPOSITORY}:${GITHUB_REF##*/}-ppc64le --arch ppc64le
|
||||
docker manifest annotate ${REPOSITORY}:${GITHUB_REF##*/} ${REPOSITORY}:${GITHUB_REF##*/}-arm64v8 --arch arm64
|
||||
docker manifest annotate ${REPOSITORY}:${GITHUB_REF##*/} ${REPOSITORY}:${GITHUB_REF##*/}-s390x --arch s390x
|
||||
docker manifest push ${REPOSITORY}:${GITHUB_REF##*/}
|
25
.github/workflows/docker-build.yml
vendored
25
.github/workflows/docker-build.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Docker-build
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
build:
|
||||
name: Docker build
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||
GO111MODULE: on
|
||||
REPOSITORY: nfvpe/multus
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build latest-amd64
|
||||
run: docker build -t ${REPOSITORY}:latest-amd64 -f deployments/Dockerfile .
|
||||
|
||||
- name: Build latest-ppc64le
|
||||
run: docker build -t ${REPOSITORY}:latest-ppc64le -f deployments/Dockerfile.ppc64le .
|
||||
|
||||
- name: Build latest-s390x
|
||||
run: docker build -t ${REPOSITORY}:latest-s390x -f deployments/Dockerfile.s390x .
|
||||
|
||||
- name: Build latest-origin
|
||||
run: docker build -t ${REPOSITORY}:latest-origin -f deployments/Dockerfile.openshift .
|
25
.github/workflows/go-build-arm64.yml
vendored
25
.github/workflows/go-build-arm64.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Go-build-arm64v8
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Build and test
|
||||
runs-on: ubuntu-latest
|
||||
if: >
|
||||
(( github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login ) &&
|
||||
github.event_name == 'pull_request' ) || (github.event_name == 'push' && github.event.commits != '[]' )
|
||||
env:
|
||||
GO111MODULE: on
|
||||
TARGET: arm64
|
||||
steps:
|
||||
- name: Set up Go 1.13
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.13
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build
|
||||
run: GOARCH="${TARGET}" ./hack/build-go.sh
|
25
.github/workflows/go-build-ppc64.yml
vendored
25
.github/workflows/go-build-ppc64.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Go-build-ppc64le
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Build and test
|
||||
runs-on: ubuntu-latest
|
||||
if: >
|
||||
(( github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login ) &&
|
||||
github.event_name == 'pull_request' ) || (github.event_name == 'push' && github.event.commits != '[]' )
|
||||
env:
|
||||
GO111MODULE: on
|
||||
TARGET: ppc64le
|
||||
steps:
|
||||
- name: Set up Go 1.13
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.13
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build
|
||||
run: GOARCH="${TARGET}" ./hack/build-go.sh
|
25
.github/workflows/go-build-s390x.yml
vendored
25
.github/workflows/go-build-s390x.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Go-build-s390x
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Build and test
|
||||
runs-on: ubuntu-latest
|
||||
if: >
|
||||
(( github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login ) &&
|
||||
github.event_name == 'pull_request' ) || (github.event_name == 'push' && github.event.commits != '[]' )
|
||||
env:
|
||||
GO111MODULE: on
|
||||
TARGET: s390x
|
||||
steps:
|
||||
- name: Set up Go 1.13
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.13
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build
|
||||
run: GOARCH="${TARGET}" ./hack/build-go.sh
|
48
.github/workflows/go-build-test-amd64.yml
vendored
48
.github/workflows/go-build-test-amd64.yml
vendored
@@ -1,48 +0,0 @@
|
||||
name: Go-build-and-test-amd64
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Build and test
|
||||
runs-on: ubuntu-latest
|
||||
if: >
|
||||
(( github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login ) &&
|
||||
github.event_name == 'pull_request' ) || (github.event_name == 'push' && github.event.commits != '[]' )
|
||||
env:
|
||||
GO111MODULE: on
|
||||
TARGET: amd64
|
||||
steps:
|
||||
- name: Set up Go 1.13
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.13
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: install goberalls
|
||||
run: go get github.com/mattn/goveralls
|
||||
|
||||
- name: install golint
|
||||
run: go get -u golang.org/x/lint/golint
|
||||
|
||||
- name: golint
|
||||
run: golint ./... | grep -v vendor | grep -v ALL_CAPS | xargs -r false
|
||||
|
||||
- name: gofmt
|
||||
run: go fmt ./...
|
||||
|
||||
- name: go vet
|
||||
run: go vet ./...
|
||||
|
||||
- name: Build
|
||||
run: GOARCH="${TARGET}" ./hack/build-go.sh
|
||||
|
||||
- name: Go test
|
||||
run: sudo ./hack/test-go.sh
|
||||
|
||||
- name: goveralls
|
||||
uses: shogo82148/actions-goveralls@v1
|
||||
with:
|
||||
path-to-profile: coverage.out
|
92
.github/workflows/image-build.yml
vendored
Normal file
92
.github/workflows/image-build.yml
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
name: Image build
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
build-amd64:
|
||||
name: Image build/amd64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build container image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: ghcr.io/${{ github.repository }}:latest-amd64
|
||||
file: deployments/Dockerfile
|
||||
|
||||
build-arm64:
|
||||
name: Image build/arm64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build container image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: ghcr.io/${{ github.repository }}:latest-arm64
|
||||
file: deployments/Dockerfile.arm64
|
||||
|
||||
build-ppc64le:
|
||||
name: Image build/ppc64le
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build container image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: ghcr.io/${{ github.repository }}:latest-ppc64le
|
||||
file: deployments/Dockerfile.ppc64le
|
||||
|
||||
build-s390:
|
||||
name: Image build/s390x
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build container image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: ghcr.io/${{ github.repository }}:latest-s390x
|
||||
file: deployments/Dockerfile.s390x
|
||||
|
||||
build-origin:
|
||||
name: Image build/origin
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build container image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: ghcr.io/${{ github.repository }}:latest-origin
|
||||
file: deployments/Dockerfile.openshift
|
187
.github/workflows/image-push-master.yml
vendored
Normal file
187
.github/workflows/image-push-master.yml
vendored
Normal file
@@ -0,0 +1,187 @@
|
||||
name: Image push for master
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
env:
|
||||
REPOSITORY: docker.io/nfvpe/multus
|
||||
REPOSITORY_USER: nfvperobot
|
||||
jobs:
|
||||
push-amd64:
|
||||
name: Image push/amd64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Push container image
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REPOSITORY }}:latest-amd64
|
||||
${{ env.REPOSITORY }}:snapshot-amd64
|
||||
file: deployments/Dockerfile
|
||||
|
||||
push-arm64:
|
||||
name: Image push/arm64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Push container image
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REPOSITORY }}:latest-arm64
|
||||
${{ env.REPOSITORY }}:snapshot-arm64
|
||||
file: deployments/Dockerfile.arm64
|
||||
|
||||
push-ppc64le:
|
||||
name: Image push/ppc64le
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Push container image
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REPOSITORY }}:latest-ppc64le
|
||||
${{ env.REPOSITORY }}:snapshot-ppc64le
|
||||
file: deployments/Dockerfile.ppc64le
|
||||
|
||||
push-s390x:
|
||||
name: Image push/s390x
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Push container image
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REPOSITORY }}:latest-s390x
|
||||
${{ env.REPOSITORY }}:snapshot-s390x
|
||||
file: deployments/Dockerfile.s390x
|
||||
|
||||
push-origin:
|
||||
name: Image push/origin
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Push container image
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REPOSITORY }}:latest-origin
|
||||
${{ env.REPOSITORY }}:snapshot-origin
|
||||
file: deployments/Dockerfile.openshift
|
||||
|
||||
push-manifest:
|
||||
needs: [push-amd64, push-arm64, push-ppc64le, push-s390x]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Create manifest for multi-arch images
|
||||
if: github.repository_owner == 'intel'
|
||||
run: |
|
||||
# get artifacts from previous steps
|
||||
docker pull ${{ env.REPOSITORY }}:snapshot-amd64
|
||||
docker pull ${{ env.REPOSITORY }}:snapshot-arm64
|
||||
docker pull ${{ env.REPOSITORY }}:snapshot-ppc64le
|
||||
docker pull ${{ env.REPOSITORY }}:snapshot-s390x
|
||||
docker pull ${{ env.REPOSITORY }}:latest-amd64
|
||||
docker pull ${{ env.REPOSITORY }}:latest-arm64
|
||||
docker pull ${{ env.REPOSITORY }}:latest-ppc64le
|
||||
docker pull ${{ env.REPOSITORY }}:latest-s390x
|
||||
docker manifest create ${{ env.REPOSITORY }}:snapshot ${{ env.REPOSITORY }}:snapshot-amd64 ${{ env.REPOSITORY }}:snapshot-arm64 ${{ env.REPOSITORY }}:snapshot-ppc64le ${{ env.REPOSITORY }}:snapshot-s390x
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:snapshot ${{ env.REPOSITORY }}:snapshot-amd64 --arch amd64
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:snapshot ${{ env.REPOSITORY }}:snapshot-arm64 --arch arm64
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:snapshot ${{ env.REPOSITORY }}:snapshot-ppc64le --arch ppc64le
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:snapshot ${{ env.REPOSITORY }}:snapshot-s390x --arch s390x
|
||||
docker manifest push ${{ env.REPOSITORY }}:snapshot
|
||||
docker manifest create ${{ env.REPOSITORY }}:latest ${{ env.REPOSITORY }}:latest-amd64 ${{ env.REPOSITORY }}:latest-arm64 ${{ env.REPOSITORY }}:latest-ppc64le ${{ env.REPOSITORY }}:latest-s390x
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:latest ${{ env.REPOSITORY }}:latest-amd64 --arch amd64
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:latest ${{ env.REPOSITORY }}:latest-arm64 --arch arm64
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:latest ${{ env.REPOSITORY }}:latest-ppc64le --arch ppc64le
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:latest ${{ env.REPOSITORY }}:latest-s390x --arch s390x
|
||||
docker manifest push ${{ env.REPOSITORY }}:latest
|
229
.github/workflows/image-push-release.yml
vendored
Normal file
229
.github/workflows/image-push-release.yml
vendored
Normal file
@@ -0,0 +1,229 @@
|
||||
name: Image push release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
env:
|
||||
REPOSITORY: docker.io/nfvpe/multus
|
||||
REPOSITORY_USER: nfvperobot
|
||||
jobs:
|
||||
push-amd64:
|
||||
name: Image push/amd64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Docker meta
|
||||
id: docker_meta
|
||||
uses: crazy-max/ghaction-docker-meta@v1
|
||||
with:
|
||||
images: ${{ env.REPOSITORY }}
|
||||
tag-latest: false
|
||||
|
||||
- name: Push container image
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REPOSITORY }}:stable-amd64
|
||||
${{ steps.docker_meta.outputs.tags }}-amd64
|
||||
file: deployments/Dockerfile
|
||||
|
||||
push-arm64:
|
||||
name: Image push/arm64
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Docker meta
|
||||
id: docker_meta
|
||||
uses: crazy-max/ghaction-docker-meta@v1
|
||||
with:
|
||||
images: ${{ env.REPOSITORY }}
|
||||
tag-latest: false
|
||||
|
||||
- name: Push container image
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REPOSITORY }}:stable-arm64
|
||||
${{ steps.docker_meta.outputs.tags }}-arm64
|
||||
file: deployments/Dockerfile.arm64
|
||||
|
||||
push-ppc64le:
|
||||
name: Image push/ppc64le
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Docker meta
|
||||
id: docker_meta
|
||||
uses: crazy-max/ghaction-docker-meta@v1
|
||||
with:
|
||||
images: ${{ env.REPOSITORY }}
|
||||
tag-latest: false
|
||||
|
||||
- name: Push container image
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REPOSITORY }}:stable-ppc64le
|
||||
${{ steps.docker_meta.outputs.tags }}-ppc64le
|
||||
file: deployments/Dockerfile.ppc64le
|
||||
|
||||
push-s390x:
|
||||
name: Image push/s390x
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Docker meta
|
||||
id: docker_meta
|
||||
uses: crazy-max/ghaction-docker-meta@v1
|
||||
with:
|
||||
images: ${{ env.REPOSITORY }}
|
||||
tag-latest: false
|
||||
|
||||
- name: Push container image
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REPOSITORY }}:stable-s390x
|
||||
${{ steps.docker_meta.outputs.tags }}-s390x
|
||||
file: deployments/Dockerfile.s390x
|
||||
|
||||
push-origin:
|
||||
name: Image push/origin
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Docker meta
|
||||
id: docker_meta
|
||||
uses: crazy-max/ghaction-docker-meta@v1
|
||||
with:
|
||||
images: ${{ env.REPOSITORY }}
|
||||
tag-latest: false
|
||||
|
||||
- name: Push container image
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REPOSITORY }}:stable-origin
|
||||
${{ steps.docker_meta.outputs.tags }}-origin
|
||||
file: deployments/Dockerfile.openshift
|
||||
|
||||
push-manifest:
|
||||
needs: [push-amd64, push-arm64, push-ppc64le, push-s390x]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Docker meta
|
||||
id: docker_meta
|
||||
uses: crazy-max/ghaction-docker-meta@v1
|
||||
with:
|
||||
images: ${{ env.REPOSITORY }}
|
||||
tag-latest: false
|
||||
|
||||
- name: Login to Container Registry
|
||||
if: github.repository_owner == 'intel'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.REPOSITORY_USER }}
|
||||
password: ${{ secrets.REPOSITORY_PASS }}
|
||||
|
||||
- name: Create manifest for multi-arch images
|
||||
if: github.repository_owner == 'intel'
|
||||
run: |
|
||||
# get artifacts from previous steps
|
||||
docker pull ${{ steps.docker_meta.outputs.tags }}-amd64
|
||||
docker pull ${{ steps.docker_meta.outputs.tags }}-arm64
|
||||
docker pull ${{ steps.docker_meta.outputs.tags }}-ppc64le
|
||||
docker pull ${{ steps.docker_meta.outputs.tags }}-s390x
|
||||
docker manifest create ${{ steps.docker_meta.outputs.tags }} ${{ steps.docker_meta.outputs.tags }}-amd64 ${{ steps.docker_meta.outputs.tags }}-arm64 ${{ steps.docker_meta.outputs.tags }}-ppc64le ${{ steps.docker_meta.outputs.tags }}-s390x
|
||||
docker manifest annotate ${{ steps.docker_meta.outputs.tags }} ${{ steps.docker_meta.outputs.tags }}-amd64 --arch amd64
|
||||
docker manifest annotate ${{ steps.docker_meta.outputs.tags }} ${{ steps.docker_meta.outputs.tags }}-arm64 --arch arm64
|
||||
docker manifest annotate ${{ steps.docker_meta.outputs.tags }} ${{ steps.docker_meta.outputs.tags }}-ppc64le --arch ppc64le
|
||||
docker manifest annotate ${{ steps.docker_meta.outputs.tags }} ${{ steps.docker_meta.outputs.tags }}-s390x --arch s390x
|
||||
docker manifest push ${{ steps.docker_meta.outputs.tags }}
|
||||
docker pull ${{ env.REPOSITORY }}:stable-amd64
|
||||
docker pull ${{ env.REPOSITORY }}:stable-arm64
|
||||
docker pull ${{ env.REPOSITORY }}:stable-ppc64le
|
||||
docker pull ${{ env.REPOSITORY }}:stable-s390x
|
||||
docker manifest create ${{ env.REPOSITORY }}:stable ${{ env.REPOSITORY }}:stable-amd64 ${{ env.REPOSITORY }}:stable-arm64 ${{ env.REPOSITORY }}:stable-ppc64le ${{ env.REPOSITORY }}:stable-s390x
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:stable ${{ env.REPOSITORY }}:stable-amd64 --arch amd64
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:stable ${{ env.REPOSITORY }}:stable-arm64 --arch arm64
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:stable ${{ env.REPOSITORY }}:stable-ppc64le --arch ppc64le
|
||||
docker manifest annotate ${{ env.REPOSITORY }}:stable ${{ env.REPOSITORY }}:stable-s390x --arch s390x
|
||||
docker manifest push ${{ env.REPOSITORY }}:stable
|
2
.github/workflows/kind-e2e.yml
vendored
2
.github/workflows/kind-e2e.yml
vendored
@@ -1,9 +1,7 @@
|
||||
name: e2e-kind
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Build and test
|
||||
runs-on: ubuntu-latest
|
||||
if: >
|
||||
(( github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login ) &&
|
||||
|
@@ -1,27 +1,24 @@
|
||||
name: Release-binaries
|
||||
|
||||
name: Release binaries
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
- 'v*'
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Unshallow
|
||||
run: git fetch --prune --unshallow
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.13.x
|
||||
go-version: 1.15.x
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v1
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
49
.github/workflows/test.yml
vendored
Normal file
49
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
on: [push, pull_request]
|
||||
name: Test
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.15.x, 1.16.x]
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Run Revive
|
||||
run: |
|
||||
GO111MODULE=off go get github.com/mgechev/revive
|
||||
$(go env GOPATH)/bin/revive -exclude ./vendor/... ./... # this is ouput for user
|
||||
$(go env GOPATH)/bin/revive -exclude ./vendor/... ./...| xargs -0 -r false # this is for github actions
|
||||
|
||||
- name: Run go fmt
|
||||
run: go fmt ./...
|
||||
#run: diff -u <(echo -n) <(gofmt -d -s .)
|
||||
|
||||
- name: Run go vet
|
||||
run: go vet ./...
|
||||
|
||||
- name: Test
|
||||
run: sudo ./hack/test-go.sh
|
||||
|
||||
- name: Send coverage
|
||||
uses: shogo82148/actions-goveralls@v1
|
||||
with:
|
||||
path-to-profile: coverage.out
|
||||
flag-name: Go-${{ matrix.go }}
|
||||
parallel: true
|
||||
|
||||
# notifies that all test jobs are finished.
|
||||
finish:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: shogo82148/actions-goveralls@v1
|
||||
with:
|
||||
parallel-finished: true
|
Reference in New Issue
Block a user