Nightly Build and Test #889
This file contains hidden or 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: | |
| jobs: | |
| nightly_test: | |
| name: Testing | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| python-version: [ '3.10', '3.11', '3.12' ] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: '0' | |
| fetch-tags: true | |
| ref: 'refs/heads/main' | |
| - name: Set up Python | |
| uses: ./.github/actions/setup-python-env | |
| - 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 licensing if necessary | |
| 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/[email protected] | |
| 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 ] | |
| environment: | |
| name: azure-pypi | |
| permissions: | |
| contents: write | |
| id-token: write # REQUIRED for OIDC | |
| attestations: write # REQUIRED by attest-build-provenance v2 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: '0' | |
| fetch-tags: true | |
| - name: Set up Python + Environment | |
| uses: ./.github/actions/setup-python-env | |
| - name: Run version checks | |
| run: make check-version | |
| - name: Build library source and wheel artifacts | |
| uses: ./.github/actions/build-library | |
| with: | |
| library-name: ${{ env.PACKAGE_NAME }} | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| - name: Verify artifacts | |
| run: make check-dist | |
| - name: Publish to Azure PyPI (uv) | |
| if: ${{ !env.ACT }} | |
| run: make publish-azure | |
| env: | |
| AZURE_PYPI_TOKEN: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} | |
| AZURE_PYPI_URL: ${{ secrets.PRIVATE_PYPI_URL }} | |
| vulnerabilities: | |
| name: Vulnerabilities | |
| needs: [ nightly_test ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: '0' | |
| fetch-tags: true | |
| - name: Set up Env | |
| uses: ./.github/actions/setup-env | |
| - name: PyAnsys Vulnerability check (on main) | |
| if: github.ref == 'refs/heads/main' | |
| uses: ansys/actions/[email protected] | |
| with: | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| python-package-name: ${{ env.PACKAGE_NAME }} | |
| token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
| run-bandit: false | |
| hide-log: false | |
| - name: PyAnsys Vulnerability check (on dev) | |
| if: github.ref != 'refs/heads/main' | |
| uses: ansys/actions/[email protected] | |
| with: | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| python-package-name: ${{ env.PACKAGE_NAME }} | |
| token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
| run-bandit: false | |
| dev-mode: true | |
| hide-log: false | |
| ci-failure: | |
| name: Teams notify on failure | |
| if: failure() | |
| needs: [ nightly_and_upload, vulnerabilities ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Microsoft Teams Notification | |
| uses: jdcargile/[email protected] | |
| 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 |