Skip to content

build-nightly is to create nightly wheel file for pypi #62

build-nightly is to create nightly wheel file for pypi

build-nightly is to create nightly wheel file for pypi #62

Workflow file for this run

name: build-nightly
run-name: ${{ github.workflow }} is to create nightly wheel file for pypi
on:
push:
# branches:
# - 'main'
#schedule:
# - cron: '0 0 * * *'
workflow_dispatch:
jobs:
build-nightly:
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
steps:
- uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_WEBIDENTITY_FOR_GITHUB_ACTIONS }}
aws-region: us-east-1
- uses: actions/checkout@v3
- run: |
pwd
sudo apt-get -y install python3-pip
pip3 --version
sudo pip3 install virtualenv
virtualenv venv
source venv/bin/activate
pip install -e .
sudo apt install npm
echo "node: $(node -v)"
echo "npm: $(npm -v)"
echo "Installing testmo cli..."
sudo npm install -g @testmo/testmo-cli
echo "Build ${{ github.event.repository.name }} Nightly..."
todaytime=`date +%Y%m%d`
export TESTMO_TOKEN=${{ secrets.TESTMO_TEST_TOKEN }}
TESTMO_URL="https://neuralmagic.testmo.net"
PROJECT_ID=9
NAME="${{ github.event.repository.name }} Nightly ${todaytime} ${GITHUB_SHA:0:7}"
SOURCE="${{ github.event.repository.name }}"
status=$(make -B build || echo 'FAILED')
echo "${{ github.event.repository.name }} build log:"
echo "${status}"
if [[ "${status}" = "FAILED" ]]; then
echo "${{ github.event.repository.name }} build failed"
echo "<status>failed</status>" > result.xml
else
echo "<status>success</status>" > result.xml
echo "${{ github.event.repository.name }} build success"
echo "Created build: $(ls dist/)"
fi
testmo automation:run:submit \
--instance "${TESTMO_URL}" \
--project-id ${PROJECT_ID} \
--name "${NAME}" \
--source "${SOURCE}" \
--results "result.xml"
deactivate
#ls dist/
#aws s3 cp dist/*nightly*.whl s3://nm-github-actions/${{ github.event.repository.name }}/
#date '+%Y%m%d-%k:%M:%S' | tee log_${GITHUB_REF_NAME}_nightly_${todaytime}_${GITHUB_SHA:0:7}
#aws s3 cp log_${GITHUB_REF_NAME}_nightly_${todaytime}_${GITHUB_SHA:0:7} s3://nm-github-actions/${{ github.event.repository.name }}/
#oldDate=`date --date='-2 month' +%Y%m%d`
#oldWhl=`(aws s3 ls s3://nm-github-actions/${{ github.event.repository.name }}/ | grep nightly | grep "${oldDate}") || echo "notfound"`
#if [[ "${oldWhl}" != 'notfound' ]]; then
# for oldwhl in $(echo "${oldWhl}" | awk '{print $4}')
# do
# echo "Remove old build ${oldwhl}"
# aws s3 rm s3://nm-github-actions/${{ github.event.repository.name }}/${oldwhl}
# done
#fi