Nightly Build and Test #548
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Build and Test | |
on: | |
schedule: # UTC at 22:00 = 6pm EDT | |
- cron: '0 22 * * *' | |
workflow_dispatch: | |
env: | |
MAIN_PYTHON_VERSION: '3.10' | |
PACKAGE_NAME: 'ansys-dynamicreporting-core' | |
PACKAGE_NAMESPACE: 'ansys.dynamicreporting.core' | |
jobs: | |
nightly_test: | |
name: Testing | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
python-version: [ '3.10', '3.11', '3.12' ] | |
steps: | |
- uses: actions/checkout@v4 | |
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: 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@v8 | |
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 }} | |
build-failure: | |
name: Teams notify on failure | |
if: failure() | |
needs: [ nightly_test, nightly_and_upload ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Microsoft Teams Notification | |
uses: jdcargile/[email protected] | |
with: | |
github-token: ${{ github.token }} | |
ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }} | |
notification-summary: Nightly failure | |
notification-color: dc3545 | |
timezone: America/New_York |