Create a Github action for MCAD CI check #6
Workflow file for this run
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 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 | |
env: | |
GIT_BRANCH: ${{ github.event.inputs.tag }} | |
TAG: $(git describe --abbrev=0 --tags) | |
run: | | |
LATEST_TAG=$(git describe --abbrev=0 --tags) | |
echo "Latest tag on target branch: $LATEST_TAG" | |
echo "GIT_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV | |
echo "TAG=$LATEST_TAG" >> $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 | |
- name: Run E2E tests | |
run: | | |
make run-e2e | |