Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): bump up github action workflow step dependency #181

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,9 +17,9 @@
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

Check warning on line 22 in buildscripts/test-cov.sh

View workflow job for this annotation

GitHub Actions / lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./buildscripts/test-cov.sh:22:57:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
Expand Down
4 changes: 2 additions & 2 deletions buildscripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
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

Check warning on line 21 in buildscripts/test.sh

View workflow job for this annotation

GitHub Actions / lint

[shellcheck] reported by reviewdog 🐶 Use single quotes, otherwise this expands now rather than when signalled. [SC2064](https://github.com/koalaman/shellcheck/wiki/SC2064) Raw Output: ./buildscripts/test.sh:21:14:warning:Use single quotes, otherwise this expands now rather than when signalled. [SC2064](https://github.com/koalaman/shellcheck/wiki/SC2064)

# Build the Maya binary for the tests
echo "--> Building csi"
go build -o $TEMPDIR/maya || exit 1

Check warning on line 25 in buildscripts/test.sh

View workflow job for this annotation

GitHub Actions / lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./buildscripts/test.sh:25:13:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)

# 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')

Check warning on line 31 in buildscripts/test.sh

View workflow job for this annotation

GitHub Actions / lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./buildscripts/test.sh:31:17:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)

Check warning on line 31 in buildscripts/test.sh

View workflow job for this annotation

GitHub Actions / lint

[shellcheck] reported by reviewdog 🐶 Quote this to prevent word splitting. [SC2046](https://github.com/koalaman/shellcheck/wiki/SC2046) Raw Output: ./buildscripts/test.sh:31:55:warning:Quote this to prevent word splitting. [SC2046](https://github.com/koalaman/shellcheck/wiki/SC2046)

Loading
Loading