Skip to content

Create a Github action for MCAD CI check #497

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

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
44 changes: 44 additions & 0 deletions .github/workflows/mcad-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow will build mcad and run unit test and E2E tests
name: MCAD-CI
on:
pull_request:
branches:
- 'main'
- 'release-*'

jobs:
MCAD-CI:
runs-on: ubuntu-latest

steps:
- name: checkout code
uses: actions/checkout@v3
with:
ref: "refs/pull/${{ github.event.number }}/merge"
fetch-depth: 0

- name: Set latest tag and Branch name
run: |
echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
echo "TAG=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18.10

- name: Build
run:
make mcad-controller

- name: Run Unit tests
run: make run-test

- name: Build Image
run: |
make images -e GIT_BRANCH=${{ env.GIT_BRANCH }} TAG=${{ env.GIT_BRANCH }}-${{ env.TAG }}
- name: Run E2E tests
run: |
make run-e2e -e GIT_BRANCH=${{ env.GIT_BRANCH }} TAG=${{ env.GIT_BRANCH }}-${{ env.TAG }}
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

# Skip CI check when running as a pull request
if: "$TRAVIS_PULL_REQUEST != false"

language: go

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