Skip to content

GitHub CI

GitHub CI #3391

Workflow file for this run

name: GitHub CI
on:
pull_request:
workflow_dispatch:
schedule:
- cron: '00 22 * * *' # UTC time, may start 5-15 mins later than scheduled time
# registry_package:
# Run workflow when package is published or updated
# types: [published]
push:
tags:
- "*"
branches:
- main
- release/*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
embedding-tests:
name: Embedding testing and coverage
runs-on: ubuntu-latest
timeout-minutes: 7
needs: []
container:
image: ghcr.io/ansys/mechanical:debug
options: --entrypoint /bin/bash
strategy:
fail-fast: false
matrix:
color: ['blue', 'green', 'yellow', 'brown', 'fuschia', 'maroon']
steps:
- uses: actions/checkout@v4
- name: Install packages for testing
run: |
python3.12 -m pip install .[tests]
- name: Unit Testing and coverage
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}
ANSYS_WORKBENCH_LOGGING_CONSOLE: 1
ANSYS_WORKBENCH_LOGGING: 1
ANSYS_WORKBENCH_LOGGING_FILTER_LEVEL: 0
EMBEDDING_ASSEMBLY_RESOLVER_STDOUT: 1
run: |
xvfb-run mechanical-env python3.12 -m pytest -m embedding -s
launch-tests:
name: Launch testing and coverage
runs-on: public-ubuntu-latest-8-cores
timeout-minutes: 15
container:
image: ghcr.io/ansys/mechanical:debug
options: --entrypoint /bin/bash
strategy:
fail-fast: false
matrix:
color: ['blue', 'green', 'yellow', 'brown', 'fuschia', 'maroon']
steps:
- uses: actions/checkout@v4
- name: Set up python and pip
run: |
apt update
apt install --reinstall ca-certificates
apt install software-properties-common -y
add-apt-repository ppa:deadsnakes/ppa -y
apt install python3.12 -y
ln -s /usr/bin/python3.12 /usr/bin/python
apt install python3.12-venv -y
python -m ensurepip --default-pip
pip3 install --upgrade pip
python --version
pip3 --version
- name: Install dependencies
run: |
apt install -y lsb-release
pip3 install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip setuptools
pip3 install --upgrade pip flit
- name: Install packages for testing
run: |
pip install .[tests]
- name: Set environment variable
run: echo "ANSYSCL242_DIR=/install/ansys_inc/v242/licensingclient" >> $GITHUB_ENV
- name: Unit Testing and coverage
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}
ANSYS_WORKBENCH_LOGGING_CONSOLE: 0
run: |
unset PYMECHANICAL_PORT
unset PYMECHANICAL_START_INSTANCE
pytest -m remote_session_launch -s