Skip to content

Nightly Build

Nightly Build #872

Workflow file for this run

name: Nightly Build
on:
schedule: # UTC at 0300 - 11pm EDT
- cron: '0 3 * * *'
workflow_dispatch:
env:
MAIN_PYTHON_VERSION: '3.10'
PACKAGE_NAME: 'ansys-pyensight-core'
ENSIGHT_IMAGE: 'ghcr.io/ansys-internal/ensight_dev'
jobs:
nightly_test:
name: Nightly tests
runs-on: ubuntu-latest
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull Docker image
run: docker pull ${{ env.ENSIGHT_IMAGE }}
- name: Run pytest
uses: ansys/actions/tests-pytest@v8
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
requires-xvfb: true
pytest-extra-args: "-n 4 --reruns 3"
- uses: codecov/codecov-action@v3
name: 'Upload coverage to CodeCov'
nightly_build:
name: Nightly build
runs-on: ubuntu-latest
steps:
- name: Build library source and wheel artifacts
uses: ansys/actions/build-library@v8
with:
library-name: ${{ env.PACKAGE_NAME }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Upload wheel
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: ansys-pyensight-wheel
path: dist/
retention-days: 7
if-no-files-found: error
# Upload a renamed wheel to the private Azure PyPi for nightly consumption
# in EnSight
- name: Upload to Ansys Azure PyPi
if: ${{ !env.ACT }}
run: |
python rename_nightly_wheel.py
twine upload --verbose dist/*.whl
env:
TWINE_USERNAME: PAT
TWINE_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
TWINE_REPOSITORY_URL: ${{ secrets.PRIVATE_PYPI_URL }}
build-failure:
name: Teams notify on failure
if: failure()
needs: [ nightly_test, nightly_build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Microsoft Teams Notification
uses: jdcargile/ms-teams-notification@v1.4
with:
github-token: ${{ github.token }}
ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
notification-summary: Nightly build failure
notification-color: dc3545
timezone: America/New_York