-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CodeQL and static checks Add hadolint as makefile target and update Dockerfile Update deploy.sh to comply with shellcheck and add shellcheck as makefile target Signed-off-by: amaslennikov <[email protected]>
- Loading branch information
1 parent
3914c00
commit be56ff6
Showing
9 changed files
with
342 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: "push an image on merge to master" | ||
|
||
env: | ||
IMAGE_NAME: ghcr.io/${{ github.repository }} | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build-and-push-amd64-k8s-rdma-shared-dev-plugin: | ||
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 k8s-rdma-shared-dev-plugin | ||
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-k8s-rdma-shared-dev-plugin: | ||
name: image push arm64 | ||
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 k8s-rdma-shared-dev-plugin | ||
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-k8s-rdma-shared-dev-plugin: | ||
name: image push ppc64le | ||
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 k8s-rdma-shared-dev-plugin | ||
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-k8s-rdma-shared-dev-plugin,build-and-push-arm64-k8s-rdma-shared-dev-plugin,build-and-push-ppc64le-k8s-rdma-shared-dev-plugin] | ||
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 }}:sha-${{ github.sha }} \ | ||
${{ env.IMAGE_NAME }}:latest-amd64 \ | ||
${{ env.IMAGE_NAME }}:latest-arm64 \ | ||
${{ env.IMAGE_NAME }}:latest-ppc64le |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: go-static-analysis | ||
on: [push, pull_request] | ||
jobs: | ||
golangci: | ||
name: Lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.20.x | ||
- name: checkout PR | ||
uses: actions/checkout@v2 | ||
- name: run make lint | ||
run: make lint | ||
hadolint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.20.x | ||
- name: checkout PR | ||
uses: actions/checkout@v2 | ||
- name: run make hadolint | ||
run: make hadolint |
Oops, something went wrong.