From 34766f659b013f4a0ba61c9b39f51fdb4e5b96e7 Mon Sep 17 00:00:00 2001 From: arvind5 Date: Wed, 20 Dec 2023 04:11:41 -0800 Subject: [PATCH] Added actions for push to main and release branches. (#40) --- .github/workflows/onmergerelease.yml | 40 ++++++++++++++++++++++++++++ .github/workflows/onpullrequest.yml | 14 +++++----- .gitignore | 1 + 3 files changed, 48 insertions(+), 7 deletions(-) create mode 100755 .github/workflows/onmergerelease.yml diff --git a/.github/workflows/onmergerelease.yml b/.github/workflows/onmergerelease.yml new file mode 100755 index 0000000..baa205f --- /dev/null +++ b/.github/workflows/onmergerelease.yml @@ -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 diff --git a/.github/workflows/onpullrequest.yml b/.github/workflows/onpullrequest.yml index 69d82e0..baf927e 100755 --- a/.github/workflows/onpullrequest.yml +++ b/.github/workflows/onpullrequest.yml @@ -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 }} @@ -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: | @@ -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 diff --git a/.gitignore b/.gitignore index 046eb15..8708953 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.vscode py-api/__pycache__/ bin/** build/**