Skip to content

Commit

Permalink
Merge pull request #77 from adrianchiris/add-image-build-test
Browse files Browse the repository at this point in the history
Update actions and add image build test
  • Loading branch information
ykulazhenkov authored Jun 3, 2024
2 parents bc32539 + 719316e commit 8035095
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 47 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/buildtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,48 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: build test for ${{ matrix.goarch }}
env:
GOARCH: ${{ matrix.goarch }}
GOOS: ${{ matrix.goos }}
run: make build


image-build:
name: image build
runs-on: ubuntu-22.04
steps:
- name: check out the repo
uses: actions/checkout@v4

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

- name: build and push accelerated-bridge-cni
uses: docker/build-push-action@v5
with:
context: .
push: false
platforms: linux/amd64
tags: |
accelerated-bridge-cni:test
file: ./Dockerfile

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

Expand All @@ -47,11 +67,11 @@ jobs:
name: coverage
steps:
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.20.x
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Go test with coverage
run: make test-coverage
- name: Coveralls
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/image-push-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: login to Docker
uses: docker/login-action@v2
uses: docker/login-action@v3
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
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -40,23 +40,23 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

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

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

- name: login to Docker
uses: docker/login-action@v2
uses: docker/login-action@v3
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
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -70,23 +70,23 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

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

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

- name: login to Docker
uses: docker/login-action@v2
uses: docker/login-action@v3
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
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -100,10 +100,10 @@ jobs:
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
uses: docker/setup-buildx-action@v3

- name: login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/image-push-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ jobs:
name: image push AMD64
steps:
- name: check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

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

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

- name: docker meta
id: docker_meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
Expand All @@ -36,7 +36,7 @@ jobs:
type=semver,pattern={{version}},enable=${{ contains(github.ref, 'refs/tags/v') }}
- name: build and push accelerated-bridge-cni
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -50,21 +50,21 @@ jobs:
name: image push ARM64
steps:
- name: check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

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

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

- name: docker meta
id: docker_meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
Expand All @@ -73,7 +73,7 @@ jobs:
type=semver,pattern={{version}},enable=${{ contains(github.ref, 'refs/tags/v') }}
- name: build and push accelerated-bridge-cni
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -87,21 +87,21 @@ jobs:
name: image push ppc64le
steps:
- name: check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

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

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

- name: docker meta
id: docker_meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
Expand All @@ -110,7 +110,7 @@ jobs:
type=semver,pattern={{version}},enable=${{ contains(github.ref, 'refs/tags/v') }}
- name: build and push accelerated-bridge-cni
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand All @@ -124,11 +124,11 @@ jobs:
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
uses: docker/setup-buildx-action@v3

- name: docker meta
id: docker_meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
Expand All @@ -137,7 +137,7 @@ jobs:
type=semver,pattern={{version}},enable=${{ contains(github.ref, 'refs/tags/v') }}
- name: login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/static-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.20.x
- name: checkout PR
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: run make lint
run: make lint
shellcheck:
runs-on: ubuntu-22.04
steps:
- name: checkout PR
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: run make shellcheck
run: make shellcheck
hadolint:
runs-on: ubuntu-22.04
steps:
- name: set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.20.x
- name: checkout PR
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: run make hadolint
run: make hadolint

0 comments on commit 8035095

Please sign in to comment.