Skip to content

Nightly Build and Test #810

Nightly Build and Test

Nightly Build and Test #810

Workflow file for this run

name: Nightly Build and Test
on:
schedule: # UTC at 22:00 = 6pm EDT
- cron: '0 22 * * *'
workflow_dispatch:
env:
MAIN_PYTHON_VERSION: '3.13'
PACKAGE_NAME: 'ansys-dynamicreporting-core'
PACKAGE_NAMESPACE: 'ansys.dynamicreporting.core'
ANSYS_VERSION: '261'
DPF_STANDALONE_SUFFIX: ''
jobs:
nightly_test:
name: Testing
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
steps:
- uses: actions/checkout@v5
with:
ref: 'refs/heads/main'
- 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 container
run: make pull-docker
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set licensing if necessary
if: ${{ env.ANSYS_VERSION > '231' }}
shell: bash
run: |
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
echo "ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}" >> $GITHUB_ENV
- name: Update packages
shell: bash
run: |
sudo apt update && sudo apt install -y \
libx11-dev \
libgl1-mesa-dev \
libxrender1
- name: Install DPF
id: set-server-path
uses: ansys/pydpf-actions/install-dpf-server@v2.3
with:
dpf-standalone-TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
standalone_suffix: ${{ env.DPF_STANDALONE_SUFFIX }}
ANSYS_VERSION : ${{ env.ANSYS_VERSION }}
- name: Run pytest
run: make test
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
nightly_and_upload:
name: nightly_and_upload
needs: [ nightly_test ]
runs-on: ubuntu-latest
steps:
- name: Build library source and wheel artifacts
uses: ansys/actions/build-library@v10
with:
library-name: ${{ env.PACKAGE_NAME }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Rename wheel
run: |
python codegen/rename_whl.py
rm -rf dist/*.tar.gz
- name: Upload to Azure PyPi
if: ${{ !env.ACT }}
run: twine upload --verbose dist/*
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
TWINE_REPOSITORY_URL: ${{ secrets.PRIVATE_PYPI_URL }}
ci-failure:
name: Teams notify on failure
if: failure()
needs: [ nightly_and_upload ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- 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_NIGHTLY }}
notification-summary: Nightly build failure
notification-color: dc3545
timezone: America/New_York