Skip to content

Commit

Permalink
chore(ci): bump up github action workflow step dependency (#181)
Browse files Browse the repository at this point in the history
* chore(github-actions): bump up github action workflow step dependency

Signed-off-by: Abhinandan Purkait <[email protected]>

* fix(build): fix shellcheck review comments

Signed-off-by: Niladri Halder <[email protected]>
Signed-off-by: Abhinandan Purkait <[email protected]>

* chore(ci): revert ci-test.sh changes

Signed-off-by: Abhinandan Purkait <[email protected]>

---------

Signed-off-by: Abhinandan Purkait <[email protected]>
Signed-off-by: Niladri Halder <[email protected]>
  • Loading branch information
Abhinandan-Purkait authored Nov 22, 2023
1 parent ed71215 commit 13a62de
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 71 deletions.
1 change: 0 additions & 1 deletion .bettercodehub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ languages:
- go
exclude:
- /pkg/generated/.*
- /vendor/.*
50 changes: 26 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Shellcheck
uses: reviewdog/action-shellcheck@v1
Expand All @@ -42,15 +42,15 @@ jobs:
reporter: github-pr-review
path: '.'
pattern: '*.sh'
exclude: './.git/*,./vendor/*'
exclude: './.git/*'

unit-test:
# to ignore builds on release
if: ${{ (github.event.ref_type != 'tag') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Unit test
run: make test
Expand All @@ -64,22 +64,25 @@ jobs:
strategy:
fail-fast: false
matrix:
kubernetes: [v1.20.1]
kubernetes: [v1.25.16]
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v4

- name: Set up Go 1.16.5
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.16.5

- name: Setup Minikube-Kubernetes
uses: manusa/actions-setup-minikube@v2.3.0
uses: medyagh/setup-minikube@latest
with:
minikube version: v1.16.0
kubernetes version: ${{ matrix.kubernetes }}
github token: ${{ secrets.GITHUB_TOKEN }}
cache: false
minikube-version: 1.31.1
driver: none
kubernetes-version: ${{ matrix.kubernetes }}
cni: calico
start-args: '--install-addons=false'

- name: Set tag
run: |
Expand All @@ -105,7 +108,7 @@ jobs:
needs: ['lint', 'unit-test', 'e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set Image Org
# sets the default IMAGE_ORG to openebs
Expand All @@ -116,7 +119,7 @@ jobs:
- name: Set Build Date
id: date
run: |
echo "::set-output name=DATE::$(date -u +'%Y-%m-%dT%H:%M:%S%Z')"
echo "DATE=$(date -u +'%Y-%m-%dT%H:%M:%S%Z')" >> $GITHUB_OUTPUT
- name: Set Tag
run: |
Expand All @@ -130,56 +133,55 @@ jobs:
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
# add each registry to which the image needs to be pushed here
images: |
${{ env.IMAGE_ORG }}/cstor-csi-driver
quay.io/${{ env.IMAGE_ORG }}/cstor-csi-driver
ghcr.io/${{ env.IMAGE_ORG }}/cstor-csi-driver
tag-latest: false
tag-custom-only: true
tag-custom: |
${{ env.TAG }}
tags: |
type=raw,value=latest,enable=false
type=raw,value=${{ env.TAG }}
- name: Print Tag info
run: |
echo "BRANCH: ${BRANCH}"
echo "${{ steps.docker_meta.outputs.tags }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
version: v0.5.1

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Quay
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

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

- name: Build & Push Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
file: ./buildscripts/cstor-csi-driver/cstor-csi-driver.Dockerfile
Expand All @@ -191,4 +193,4 @@ jobs:
DBUILD_DATE=${{ steps.date.outputs.DATE }}
DBUILD_REPO_URL=https://github.com/openebs/cstor-csi
DBUILD_SITE_URL=https://openebs.io
BRANCH=${{ env.BRANCH }}
BRANCH=${{ env.BRANCH }}
34 changes: 18 additions & 16 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Shellcheck
uses: reviewdog/action-shellcheck@v1
Expand All @@ -41,13 +41,12 @@ jobs:
reporter: github-pr-review
path: '.'
pattern: '*.sh'
exclude: './vendor/*'

unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Unit test
run: make test
Expand All @@ -61,22 +60,25 @@ jobs:
strategy:
fail-fast: false
matrix:
kubernetes: [v1.20.1]
kubernetes: [v1.25.16]
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v4

- name: Set up Go 1.16
uses: actions/setup-go@v2
- name: Set up Go 1.16.5
uses: actions/setup-go@v4
with:
go-version: 1.16.5

- name: Setup Minikube-Kubernetes
uses: manusa/actions-setup-minikube@v2.3.0
uses: medyagh/setup-minikube@latest
with:
minikube version: v1.16.0
kubernetes version: ${{ matrix.kubernetes }}
github token: ${{ secrets.GITHUB_TOKEN }}
cache: false
minikube-version: 1.31.1
driver: none
kubernetes-version: ${{ matrix.kubernetes }}
cni: calico
start-args: '--install-addons=false'

- name: Set tag
run: |
Expand All @@ -102,25 +104,25 @@ jobs:
needs: ['lint', 'unit-test', 'e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

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

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
version: v0.5.1

- name: Build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
file: ./buildscripts/cstor-csi-driver/cstor-csi-driver.Dockerfile
push: false
platforms: linux/amd64, linux/arm64
tags: |
openebs/cstor-csi-driver:ci
openebs/cstor-csi-driver:ci
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Set Image Org
# sets the default IMAGE_ORG to openebs
Expand Down Expand Up @@ -63,38 +63,38 @@ jobs:
echo "RELEASE TAG: ${RELEASE_TAG}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
version: v0.5.1

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Quay
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

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

- name: Build & Push Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
file: ./buildscripts/cstor-csi-driver/cstor-csi-driver.Dockerfile
Expand All @@ -106,4 +106,4 @@ jobs:
DBUILD_DATE=${{ steps.date.outputs.DATE }}
DBUILD_REPO_URL=https://github.com/openebs/cstor-csi
DBUILD_SITE_URL=https://openebs.io
RELEASE_TAG=${{ env.RELEASE_TAG }}
RELEASE_TAG=${{ env.RELEASE_TAG }}
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods \
# Tools required for different make
# targets or for development purposes
EXTERNAL_TOOLS=\
golang.org/x/tools/cmd/cover \
github.com/axw/gocov/gocov \
gopkg.in/matm/v1/gocov-html \
github.com/onsi/ginkgo/ginkgo \
github.com/onsi/gomega/...
golang.org/x/tools/cmd/cover@latest \
github.com/axw/gocov/gocov@latest \
github.com/matm/gocov-html/cmd/gocov-html@latest \
github.com/onsi/ginkgo/[email protected]

# The images can be pushed to any docker/image registeries
# like docker hub, quay. The registries are specified in
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/test-cov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
set -e
echo "" > coverage.txt

for d in $(go list ./... | grep -v 'vendor\|pkg/apis\|pkg/client\|tests'); do
for d in $(go list ./... | grep -v 'pkg/apis\|pkg/client\|tests'); do
#TODO - Include -race while creating the coverage profile.
go test -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
Expand Down
4 changes: 2 additions & 2 deletions buildscripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
set -e

# Create a temp dir and clean it up on exit
TEMPDIR=`mktemp -d -t csi-test.XXX`
TEMPDIR=$(mktemp -d -t csi-test.XXX)
trap "rm -rf $TEMPDIR" EXIT HUP INT QUIT TERM

# Build the Maya binary for the tests
Expand All @@ -26,7 +26,7 @@ go build -o $TEMPDIR/maya || exit 1

# Run the tests
echo "--> Running tests"
GOBIN="`which go`"
GOBIN="$(which go)"
PATH=$TEMPDIR:$PATH \
$GOBIN test ${GOTEST_FLAGS:--cover -timeout=900s} $($GOBIN list ./... | grep -v 'vendor\|pkg/apis\|pkg/generated\|tests')

Loading

0 comments on commit 13a62de

Please sign in to comment.