-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: enhance pull_request workflow (#557)
* ci: enhance pull_request workflow Signed-off-by: Abhinandan Purkait <[email protected]> * chore: use ct via nix-shell, Signed-off-by: Abhinandan Purkait <[email protected]> * chore: add the csi-driver step Signed-off-by: Abhinandan Purkait <[email protected]> * fix: the release regex Signed-off-by: Abhinandan Purkait <[email protected]> * chore: remove test.test binary Signed-off-by: Abhinandan Purkait <[email protected]> * chore: add gitignore entry for .test files Signed-off-by: Abhinandan Purkait <[email protected]> * fix: remove redundant die method Signed-off-by: Abhinandan Purkait <[email protected]> * fix: set analytics to be disabled on ci Signed-off-by: Abhinandan Purkait <[email protected]> * fix: shebang, condition check, script input Signed-off-by: Abhinandan Purkait <[email protected]> * chore: move zfs env setup inside nix Signed-off-by: Abhinandan Purkait <[email protected]> * chore: get IMAGE_TAG from chart Signed-off-by: Abhinandan Purkait <[email protected]> * ci: disable the chart releaser workflow temporarily Signed-off-by: Abhinandan Purkait <[email protected]> * chore: don't use yq for extracting version in Makefile Signed-off-by: Abhinandan Purkait <[email protected]> --------- Signed-off-by: Abhinandan Purkait <[email protected]>
- Loading branch information
1 parent
ea5d6f9
commit c45ef19
Showing
18 changed files
with
407 additions
and
160 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,38 +1,25 @@ | ||
# Copyright 2020 The OpenEBS Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: ci | ||
name: Pull Request CI | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'deploy/helm/**' | ||
- 'docs/**' | ||
- 'design/**' | ||
- 'changelogs/**' | ||
- '*.md' | ||
- 'MAINTAINERS' | ||
branches: | ||
# on pull requests to develop and release branches | ||
- develop | ||
- 'v*' | ||
- 'release/**' | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Shellcheck | ||
uses: reviewdog/action-shellcheck@v1 | ||
|
@@ -41,9 +28,21 @@ jobs: | |
reporter: github-pr-review | ||
path: '.' | ||
pattern: '*.sh' | ||
|
||
- uses: cachix/install-nix-action@v22 | ||
- uses: rrbutani/[email protected] | ||
with: | ||
file: shell.nix | ||
- name: Check if the chart follows a valid semver version | ||
run: | | ||
branch_name="${{ github.event.pull_request.base.ref }}" | ||
./scripts/validate-chart-version.sh --branch $branch_name | ||
- name: Run chart-testing lint | ||
run: | | ||
ct lint --config ct.yaml | ||
|
||
unit-test: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -60,9 +59,9 @@ jobs: | |
name: coverage-$(date +%s) | ||
flags: unittests | ||
|
||
bdd-test: | ||
needs: ['unit-test'] | ||
bdd-tests: | ||
runs-on: ubuntu-latest | ||
needs: ['unit-tests'] | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
|
@@ -71,19 +70,26 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Installation | ||
run: | | ||
sudo apt-get update -qq | ||
sudo apt-get install -y zfsutils-linux | ||
truncate -s 100G /tmp/disk.img | ||
sudo zpool create zfspv-pool `sudo losetup -f /tmp/disk.img --show` | ||
- uses: cachix/install-nix-action@v22 | ||
- uses: rrbutani/[email protected] | ||
with: | ||
file: shell.nix | ||
|
||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19.9 | ||
cache: false | ||
|
||
- name: Build images locally | ||
run: make zfs-driver-image || exit 1; | ||
|
||
- name: Setup zfs pools | ||
run: | | ||
sudo apt-get install zfsutils-linux -y | ||
truncate -s 100G /tmp/disk.img | ||
sudo zpool create zfspv-pool $(sudo losetup -f /tmp/disk.img --show) | ||
- name: Setup Minikube-Kubernetes | ||
uses: medyagh/setup-minikube@latest | ||
with: | ||
|
@@ -99,9 +105,6 @@ jobs: | |
echo "KUBECONFIG=$HOME/.kube/config" >> $GITHUB_ENV | ||
echo "OPENEBS_NAMESPACE=openebs" >> $GITHUB_ENV | ||
- name: Build images locally | ||
run: make zfs-driver-image || exit 1; | ||
|
||
- name: bootstrap | ||
run: make bootstrap | ||
|
||
|
@@ -120,7 +123,7 @@ jobs: | |
|
||
csi-driver: | ||
runs-on: ubuntu-latest | ||
needs: ['lint', 'bdd-test'] | ||
needs: ['lint', 'bdd-tests'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -133,8 +136,6 @@ jobs: | |
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
version: v0.13.1 | ||
|
||
- name: Build | ||
uses: docker/build-push-action@v5 | ||
|
@@ -143,6 +144,3 @@ jobs: | |
file: ./buildscripts/zfs-driver/zfs-driver.Dockerfile | ||
push: false | ||
platforms: linux/amd64, linux/arm64 | ||
tags: | | ||
openebs/zfs-driver:ci | ||
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ tags | |
*.swo | ||
*.swn | ||
*.idea | ||
*.test |
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
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
Oops, something went wrong.