Skip to content

Commit

Permalink
Merge pull request #266 from adrianchiris/workflow-maintenance
Browse files Browse the repository at this point in the history
Workflow Maintenance
  • Loading branch information
SchSeba authored May 30, 2023
2 parents aa5c230 + 0368a17 commit 660c3c9
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 73 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/buildtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
GO111MODULE: on
steps:
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Build test for ${{ matrix.goarch }}
env:
Expand All @@ -41,7 +41,7 @@ jobs:
name: coverage
steps:
- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v4
with:
go-version: 1.20.x

Expand All @@ -52,7 +52,7 @@ jobs:
run: sudo make test-coverage # sudo needed for netns change in test

- name: Coveralls
uses: coverallsapp/github-action@1.1.3
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: test/coverage/lcov.info
file: test/coverage/lcov.info
50 changes: 21 additions & 29 deletions .github/workflows/image-push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,51 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to Docker
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push sriov-cni
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64
tags: |
${{ env.IMAGE_NAME }}:latest-amd64
${{ steps.docker_meta.outputs.tags }}:${{ github.sha }}
${{ env.IMAGE_NAME }}:${{ github.sha }}
file: ./Dockerfile

build-and-push-arm64-sriov-cni:
name: Image Push ARM64
runs-on: ubuntu-20.04
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to Docker
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push sriov-cni
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand All @@ -71,23 +71,23 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to Docker
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push sriov-cni
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand All @@ -101,26 +101,18 @@ jobs:
needs: [build-and-push-amd64-sriov-cni,build-and-push-amr64-sriov-cni,build-and-push-ppc64le-sriov-cni]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create manifest for multi-arch images
run: |
# pull
docker pull ${{ env.IMAGE_NAME }}:latest-amd64
docker pull ${{ env.IMAGE_NAME }}:latest-arm64
docker pull ${{ env.IMAGE_NAME }}:latest-ppc64le
# create
docker manifest create ${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:latest-amd64 ${{ env.IMAGE_NAME }}:latest-arm64 ${{ env.IMAGE_NAME }}:latest-ppc64le
# annotate
docker manifest annotate ${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:latest-amd64 --arch amd64
docker manifest annotate ${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:latest-arm64 --arch arm64
docker manifest annotate ${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:latest-ppc64le --arch ppc64le
# push
docker manifest push ${{ env.IMAGE_NAME }}:latest
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:latest \
${{ env.IMAGE_NAME }}:latest-amd64 \
${{ env.IMAGE_NAME }}:latest-arm64 \
${{ env.IMAGE_NAME }}:latest-ppc64le
64 changes: 30 additions & 34 deletions .github/workflows/image-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,28 @@ jobs:
name: Image push AMD64
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to Docker
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
tag-latest: false
tags: |
type=ref,event=tag
- name: Build and push sriov-cni
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand All @@ -48,27 +49,28 @@ jobs:
name: Image push ARM64
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to Docker
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
tag-latest: false
tags: |
type=ref,event=tag
- name: Build and push sriov-cni
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand All @@ -82,27 +84,28 @@ jobs:
name: Image push ppc64le
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to Docker
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
tag-latest: false
tags: |
type=ref,event=tag
- name: Build and push sriov-cni
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand All @@ -116,33 +119,26 @@ jobs:
needs: [build-and-push-amd64-sriov-cni,build-and-push-amr64-sriov-cni,build-and-push-ppc64le-sriov-cni]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
tag-latest: false
tags: |
type=ref,event=tag
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create manifest for multi-arch images
run: |
# pull
docker pull ${{ steps.docker_meta.outputs.tags }}-amd64
docker pull ${{ steps.docker_meta.outputs.tags }}-arm64
docker pull ${{ steps.docker_meta.outputs.tags }}-ppc64le
# create
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
# annotate
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
# push
docker manifest push ${{ steps.docker_meta.outputs.tags }}
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.tags }} \
${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.tags }}-amd64 \
${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.tags }}-arm64 \
${{ env.IMAGE_NAME }}:${{ steps.docker_meta.outputs.tags }}-ppc64le
10 changes: 5 additions & 5 deletions .github/workflows/static-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: "1.20"
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: run make lint
run: make lint
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
hadolint:
runs-on: ubuntu-latest
name: Hadolint
steps:
- uses: actions/checkout@v2
- uses: brpaz/hadolint-action@v1.2.1
- uses: actions/checkout@v3
- uses: hadolint/hadolint-action@v3.1.0
name: Run Hadolint
with:
dockerfile: Dockerfile

0 comments on commit 660c3c9

Please sign in to comment.