Skip to content

Commit

Permalink
Update golang to 1.20 and its dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: amaslennikov <[email protected]>
  • Loading branch information
almaslennikov committed Jul 10, 2023
1 parent 3bf8604 commit 7f0eca3
Show file tree
Hide file tree
Showing 15 changed files with 593 additions and 642 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/build-images.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/build.yml

This file was deleted.

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: accelerated-bridge.cover
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "14 4 * * 4"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ go ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
118 changes: 118 additions & 0 deletions .github/workflows/image-push-master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: "push images on merge to master"

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

on:
push:
branches:
- master
jobs:
build-and-push-amd64-accelerated-bridge-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 accelerated-bridge-cni
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64
tags: |
${{ env.IMAGE_NAME }}:latest-amd64
${{ env.IMAGE_NAME }}:${{ github.sha }}
file: ./Dockerfile

build-and-push-arm64-accelerated-bridge-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 accelerated-bridge-cni
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/arm64
tags: |
${{ env.IMAGE_NAME }}:latest-arm64
file: ./Dockerfile.arm64

build-and-push-ppc64le-accelerated-bridge-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 accelerated-bridge-cni
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/ppc64le
tags: |
${{ env.IMAGE_NAME }}:latest-ppc64le
file: ./Dockerfile.ppc64le

push-manifest:
runs-on: ubuntu-22.04
needs: [build-and-push-amd64-accelerated-bridge-cni,build-and-push-arm64-accelerated-bridge-cni,build-and-push-ppc64le-accelerated-bridge-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 \
${{ env.IMAGE_NAME }}:latest-amd64 \
${{ env.IMAGE_NAME }}:latest-arm64 \
${{ env.IMAGE_NAME }}:latest-ppc64le
Loading

0 comments on commit 7f0eca3

Please sign in to comment.