Skip to content

Commit

Permalink
Housekeeping (#80)
Browse files Browse the repository at this point in the history
* Update golang to 1.20 and its dependencies

add vendor folder to .gitignore

Signed-off-by: amaslennikov <[email protected]>

* Update github actions

Arm64 build
Static scans (golangci-lint, hadolint, shellcheck)
Update Dockerfile to comply with Hadolint check
Update entrypoint.sh to comply with Shellcheck

Signed-off-by: amaslennikov <[email protected]>

---------

Signed-off-by: amaslennikov <[email protected]>
  • Loading branch information
almaslennikov authored Sep 6, 2023
1 parent 5328231 commit 805d519
Show file tree
Hide file tree
Showing 207 changed files with 14,945 additions and 4,406 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/buildtest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: go-build-and-test-amd64
on:
push:
pull_request:
schedule:
- cron: "0 8 * * 0" # every sunday
jobs:
build:
name: build
strategy:
matrix:
go-version: [1.20.x]
os: [ubuntu-22.04]
goos: [linux]
goarch: [amd64]
runs-on: ${{ matrix.os }}
steps:
- name: set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: check out code into the Go module directory
uses: actions/checkout@v2
- name: build test for ${{ matrix.goarch }}
env:
GOARCH: ${{ matrix.goarch }}
GOOS: ${{ matrix.goos }}
run: make build

test:
name: test
runs-on: ubuntu-22.04
needs: build
steps:
- name: set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: check out code into the Go module directory
uses: actions/checkout@v3
- name: run unit-test
run: make test

coverage:
runs-on: ubuntu-22.04
needs: build
name: coverage
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Go test with coverage
run: make test-coverage # sudo needed for netns change in test
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ib-sriov-cni.cover
34 changes: 0 additions & 34 deletions .github/workflows/buildtest.yml

This file was deleted.

117 changes: 117 additions & 0 deletions .github/workflows/image-push-master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: "push images on merge to master"

env:
IMAGE_NAME: ghcr.io/${{ github.repository }}

on:
push:
branches:
- master
jobs:
build-and-push-amd64-ib-sriov-cni:
name: image push amd64
runs-on: ubuntu-22.04
steps:
- name: check out the repo
uses: actions/checkout@v3

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

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

- name: build and push ib-sriov-cni
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64
tags: |
${{ env.IMAGE_NAME }}:latest-amd64
file: ./Dockerfile

build-and-push-arm64-ib-sriov-cni:
name: image push arm64
runs-on: ubuntu-22.04
steps:
- name: check out the repo
uses: actions/checkout@v3

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

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

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

- name: build and push ib-sriov-cni
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/arm64
tags: |
${{ env.IMAGE_NAME }}:latest-arm64
file: ./Dockerfile

build-and-push-ppc64le-ib-sriov-cni:
name: image Push ppc64le
runs-on: ubuntu-22.04
steps:
- name: check out the repo
uses: actions/checkout@v3

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

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

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

- name: build and push ib-sriov-cni
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/ppc64le
tags: |
${{ env.IMAGE_NAME }}:latest-ppc64le
file: ./Dockerfile

push-manifest:
runs-on: ubuntu-22.04
needs: [build-and-push-amd64-ib-sriov-cni,build-and-push-arm64-ib-sriov-cni,build-and-push-ppc64le-ib-sriov-cni]
steps:
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: login to GitHub Container Registry
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: |
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:latest -t ${{ env.IMAGE_NAME }}:${{ github.sha }} \
${{ env.IMAGE_NAME }}:latest-amd64 \
${{ env.IMAGE_NAME }}:latest-arm64 \
${{ env.IMAGE_NAME }}:latest-ppc64le
33 changes: 0 additions & 33 deletions .github/workflows/image-push-master.yml

This file was deleted.

Loading

0 comments on commit 805d519

Please sign in to comment.