Skip to content

Commit 586eb13

Browse files
Merge pull request #497 from Srihari1192/automate-PRCheck-480
Create a Github action for MCAD CI check
2 parents a1984c7 + f67ee62 commit 586eb13

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

.github/workflows/mcad-CI.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will build mcad and run unit test and E2E tests
2+
name: MCAD-CI
3+
on:
4+
pull_request:
5+
branches:
6+
- 'main'
7+
- 'release-*'
8+
9+
jobs:
10+
MCAD-CI:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: checkout code
15+
uses: actions/checkout@v3
16+
with:
17+
ref: "refs/pull/${{ github.event.number }}/merge"
18+
fetch-depth: 0
19+
20+
- name: Set latest tag and Branch name
21+
run: |
22+
echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
23+
echo "TAG=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
24+
25+
- name: Set up Go
26+
uses: actions/setup-go@v3
27+
with:
28+
go-version: 1.18.10
29+
30+
- name: Build
31+
run:
32+
make mcad-controller
33+
34+
- name: Run Unit tests
35+
run: make run-test
36+
37+
- name: Build Image
38+
run: |
39+
make images -e GIT_BRANCH=${{ env.GIT_BRANCH }} TAG=${{ env.GIT_BRANCH }}-${{ env.TAG }}
40+
41+
- name: Run E2E tests
42+
run: |
43+
make run-e2e -e GIT_BRANCH=${{ env.GIT_BRANCH }} TAG=${{ env.GIT_BRANCH }}-${{ env.TAG }}
44+

.travis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
# Skip CI check when running as a pull request
3+
if: "$TRAVIS_PULL_REQUEST != false"
4+
15
language: go
26

37
sudo: required
@@ -25,8 +29,6 @@ script:
2529
- make run-test
2630
# Process 'make images' when NOT a pull request
2731
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then make images; fi'
28-
# Process 'make images' when running as a pull request
29-
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then unset quay_repository && make images; fi'
3032
# Process 'make push-images' when NOT a pull request
3133
- 'if [[ "$TRAVIS_PULL_REQUEST" == "false" && ! "$TRAVIS_BRANCH" =~ "^v[0-9]\.[0-9]+\.[0-9]+" ]]; then make push-images; fi'
3234
# Run the e2e and handle Travis condition where Travis fails on no output for 10 minutes. No output for 10 minutes

0 commit comments

Comments
 (0)