-
Notifications
You must be signed in to change notification settings - Fork 69
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(actions): move travis tests to github actions #223
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5fb57da
chore(actions): move travis tests to github actions
shubham14bajpai f9d6d15
check if the local images are used or pulled
shubham14bajpai 5f673d0
added actions for build and release
shubham14bajpai 3d33695
moved unit tests to the same workflow
shubham14bajpai 6c515ee
addressed review comments
shubham14bajpai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,9 +31,66 @@ jobs: | |
pattern: '*.sh' | ||
exclude: './.git/*,./vendor/*' | ||
|
||
unit-tests: | ||
name: unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.14 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.14.7 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: verify license | ||
run: make license-check | ||
|
||
- name: verify dependencies | ||
run: make deps | ||
|
||
- name: verify tests | ||
run: make test | ||
|
||
e2e-tests: | ||
needs: ['unit-tests'] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
kubernetes: [v1.18.6] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Minikube-Kubernetes | ||
uses: manusa/[email protected] | ||
with: | ||
minikube version: v1.9.2 | ||
kubernetes version: ${{ matrix.kubernetes }} | ||
github token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set tag | ||
run: | | ||
BRANCH="${GITHUB_REF##*/}" | ||
CI_TAG=${BRANCH#v}-ci | ||
if [ ${BRANCH} = "master" ]; then | ||
CI_TAG="ci" | ||
fi | ||
echo "TAG=${CI_TAG}" >> $GITHUB_ENV | ||
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV | ||
|
||
- name: Build images locally | ||
run: make all.amd64 || exit 1; | ||
akhilerm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Running tests | ||
run: ./ci/sanity/install.sh && ./ci/sanity/sanity.sh | ||
|
||
cspc-operator: | ||
runs-on: ubuntu-latest | ||
needs: ['lint'] | ||
needs: ['lint', 'e2e-tests'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
@@ -79,7 +136,7 @@ jobs: | |
|
||
cvc-operator: | ||
runs-on: ubuntu-latest | ||
needs: ['lint'] | ||
needs: ['lint', 'e2e-tests'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
@@ -125,7 +182,7 @@ jobs: | |
|
||
pool-manager: | ||
runs-on: ubuntu-latest | ||
needs: ['lint'] | ||
needs: ['lint', 'e2e-tests'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
@@ -171,7 +228,7 @@ jobs: | |
|
||
volume-manager: | ||
runs-on: ubuntu-latest | ||
needs: ['lint'] | ||
needs: ['lint', 'e2e-tests'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
@@ -217,7 +274,7 @@ jobs: | |
|
||
cstor-webhook: | ||
runs-on: ubuntu-latest | ||
needs: ['lint'] | ||
needs: ['lint', 'e2e-tests'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
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 |
---|---|---|
|
@@ -36,7 +36,7 @@ jobs: | |
path: '.' | ||
pattern: '*.sh' | ||
exclude: './vendor/*' | ||
|
||
cspc-operator: | ||
runs-on: ubuntu-latest | ||
needs: ['lint'] | ||
|
@@ -151,3 +151,57 @@ jobs: | |
env: | ||
IMG_RESULT: cache | ||
run: make docker.buildx.cstor-webhook | ||
|
||
unit-tests: | ||
name: unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.14 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.14.7 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: verify license | ||
run: make license-check | ||
|
||
- name: verify dependencies | ||
run: make deps | ||
|
||
- name: verify tests | ||
run: make test | ||
|
||
e2e-tests: | ||
needs: ['unit-tests'] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
kubernetes: [v1.18.6] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Minikube-Kubernetes | ||
uses: manusa/[email protected] | ||
with: | ||
minikube version: v1.9.2 | ||
kubernetes version: ${{ matrix.kubernetes }} | ||
github token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set tag | ||
run: | | ||
BRANCH="${GITHUB_REF##*/}" | ||
CI_TAG="ci" | ||
echo "TAG=${CI_TAG}" >> $GITHUB_ENV | ||
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV | ||
|
||
- name: Build images locally | ||
run: make all.amd64 || exit 1; | ||
|
||
- name: Running tests | ||
run: ./ci/sanity/install.sh && ./ci/sanity/sanity.sh |
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 |
---|---|---|
|
@@ -19,8 +19,62 @@ on: | |
- 'v*' | ||
|
||
jobs: | ||
unit-tests: | ||
name: unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.14 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.14.7 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: verify license | ||
run: make license-check | ||
|
||
- name: verify dependencies | ||
run: make deps | ||
|
||
- name: verify tests | ||
run: make test | ||
|
||
e2e-tests: | ||
needs: ['unit-tests'] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
kubernetes: [v1.18.6] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Minikube-Kubernetes | ||
uses: manusa/[email protected] | ||
with: | ||
minikube version: v1.9.2 | ||
kubernetes version: ${{ matrix.kubernetes }} | ||
github token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set Tag | ||
run: | | ||
TAG="${GITHUB_REF#refs/*/v}" | ||
echo "TAG=${TAG}" >> $GITHUB_ENV | ||
echo "RELEASE_TAG=${TAG}" >> $GITHUB_ENV | ||
|
||
- name: Build images locally | ||
run: make all.amd64 || exit 1; | ||
|
||
- name: Running tests | ||
run: ./ci/sanity/install.sh && ./ci/sanity/sanity.sh | ||
|
||
cspc-operator: | ||
runs-on: ubuntu-latest | ||
needs: ['e2e-tests'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
@@ -61,6 +115,7 @@ jobs: | |
|
||
cvc-operator: | ||
runs-on: ubuntu-latest | ||
needs: ['e2e-tests'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
@@ -101,6 +156,7 @@ jobs: | |
|
||
pool-manager: | ||
runs-on: ubuntu-latest | ||
needs: ['e2e-tests'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
@@ -141,6 +197,7 @@ jobs: | |
|
||
volume-manager: | ||
runs-on: ubuntu-latest | ||
needs: ['e2e-tests'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
@@ -181,6 +238,7 @@ jobs: | |
|
||
cstor-webhook: | ||
runs-on: ubuntu-latest | ||
needs: ['e2e-tests'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shubham14bajpai Do we need e2e to be dependent on unit-tests. ?
IMHO,
lint
,unit-tests
ande2e-tests
can be run in parallel. Only the final build/push needs to be dependent on all these 3 jobs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think checking the modules using make deps and running unit tests to check for syntactical errors is good before building and running the images.