diff --git a/.github/workflows/cicd-pr-dev-master.yaml b/.github/workflows/cicd-pr-dev-master.yaml index 55a33bc..4097081 100644 --- a/.github/workflows/cicd-pr-dev-master.yaml +++ b/.github/workflows/cicd-pr-dev-master.yaml @@ -162,7 +162,6 @@ jobs: - name: Run tests env: - OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }} DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/.github/workflows/cicd-push-dev.yaml b/.github/workflows/cicd-push-dev.yaml index 61d3f7f..9604872 100644 --- a/.github/workflows/cicd-push-dev.yaml +++ b/.github/workflows/cicd-push-dev.yaml @@ -137,7 +137,6 @@ jobs: - name: Run tests env: - OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }} DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/.github/workflows/cicd-push-master.yaml b/.github/workflows/cicd-push-master.yaml index 4596ec2..5fb8276 100644 --- a/.github/workflows/cicd-push-master.yaml +++ b/.github/workflows/cicd-push-master.yaml @@ -59,6 +59,64 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_CHECK }} if: always() + test: + runs-on: ubuntu-latest + needs: [build] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + + - name: Cache virtualenv + uses: actions/cache@v4 + with: + path: venv + key: ${{ runner.os }}-python-venv + restore-keys: | + ${{ runner.os }}-python-venv- + + - name: Run tests + env: + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + run: | + source venv/bin/activate + sudo apt update + sudo apt install python3-opencv -y + pip install pytest pytest-cov + pytest --cov --cov-report=xml --junitxml=junit.xml -o junit_family=legacy + + - name: Upload test results to Codecov + uses: codecov/test-results-action@v1 + with: + flags: python3.11 + token: ${{ secrets.CODECOV_TOKEN }} + if: always() + + - name: Upload results to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + if: always() + + - name: Slack webhook + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + author_name: zerohertzLib + fields: repo,message,commit,author,action,eventName,ref,workflow,job,took + if_mention: failure,cancelled + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_CHECK }} + if: always() + # deploy-github: # runs-on: ubuntu-latest # needs: [build]