Skip to content

Commit

Permalink
Added actions for push to main and release branches. (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
arvind5 committed Dec 20, 2023
1 parent cb51146 commit 34766f6
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 7 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/onmergerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: OnMergeRelease

on:
push:
branches:
- 'main'
- 'release/*'
tags:
- '**'

jobs:
build-test:
runs-on: [ ubuntu-20.04 ]
env:
http_proxy: ${{ secrets.HTTP_PROXY }}
https_proxy: ${{ secrets.HTTPS_PROXY }}
no_proxy: ${{ secrets.NO_PROXY }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Build sgx example
run: make sgx_token_docker
- name: Build tdx example
run: make tdx_token_docker

- name: Unit Test Coverage
run: |
test_output=$(make test-coverage)
if [ $? -ne 0 ]; then
echo "Unit tests failed"
exit 1
fi
COVERAGE=$(make test-coverage | grep 'Total:|' | awk -F\| '{print $2}' | awk -F. '{print $1}')
echo "Unit test coverage for Client is - $COVERAGE%"
if [[ $COVERAGE -lt 80 ]]; then
echo "Unit test coverage must be above 80%"
exit 1
fi
14 changes: 7 additions & 7 deletions .github/workflows/onpullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
build-test:
runs-on: [ self-hosted, taas ]
runs-on: [ ubuntu-20.04 ]
env:
http_proxy: ${{ secrets.HTTP_PROXY }}
https_proxy: ${{ secrets.HTTPS_PROXY }}
Expand All @@ -14,11 +14,11 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build sgx
run: make sgx_token_docker
- name: Build tdx
run: make tdx_token_docker

- name: Build sgx example
run: make sgx_token_docker
- name: Build tdx example
run: make tdx_token_docker

- name: Unit Test Coverage
run: |
Expand All @@ -27,8 +27,8 @@ jobs:
echo "Unit tests failed"
exit 1
fi
COVERAGE=$(make test-coverage | grep 'Total:|' | awk -F\| '{print $2}' | awk -F. '{print $1}')
echo "Unit test coverage for C Client is - $COVERAGE%"
COVERAGE=$(make test-coverage | grep 'Total:|' | awk -F\| '{print $2}' | awk -F. '{print $1}')
echo "Unit test coverage for Client is - $COVERAGE%"
if [[ $COVERAGE -lt 80 ]]; then
echo "Unit test coverage must be above 80%"
exit 1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode
py-api/__pycache__/
bin/**
build/**
Expand Down

0 comments on commit 34766f6

Please sign in to comment.