|
55 | 55 | run: |
|
56 | 56 | python -c "import pyaedt; from pyaedt import __version__"
|
57 | 57 |
|
| 58 | + smoke-tests-with-install-target: |
| 59 | + name: Build and perform smoke tests with install target ${{ matrix.target }} |
| 60 | + runs-on: ${{ matrix.os }} |
| 61 | + strategy: |
| 62 | + fail-fast: false |
| 63 | + matrix: |
| 64 | + os: [ubuntu-latest, windows-latest] |
| 65 | + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] |
| 66 | + install_target: ['tests', 'dotnet', 'doc', 'doc-noexamples', 'full'] |
| 67 | + steps: |
| 68 | + - name: "Install Git and clone project" |
| 69 | + uses: actions/checkout@v4 |
| 70 | + |
| 71 | + - name: Setup Python |
| 72 | + uses: actions/setup-python@v4 |
| 73 | + with: |
| 74 | + python-version: ${{ matrix.python-version }} |
| 75 | + |
| 76 | + - name: "Update pip and install the build and wheel libraries" |
| 77 | + shell: bash |
| 78 | + run: | |
| 79 | + python -m pip install --upgrade pip build wheel |
| 80 | +
|
| 81 | + - name: "Install the library" |
| 82 | + shell: bash |
| 83 | + run: | |
| 84 | + python -m pip install ${{ matrix.install_target }} |
| 85 | +
|
| 86 | + - name: "Verify if importlib-metadata needs to be installed" |
| 87 | + shell: bash |
| 88 | + run: | |
| 89 | + python_version="${{ matrix.python-version }}" |
| 90 | + minor_python_version=$(echo "$python_version" | awk -F "." '{print $2}') |
| 91 | + major_python_version=$(echo "$python_version" | awk -F "." '{print $1}') |
| 92 | + if (( $(( $major_python_version == 3 )) )) && (( $(( $minor_python_version < 8 )) )); then |
| 93 | + echo "needs_importlib_metadata=true" >> $GITHUB_ENV |
| 94 | + elif (( $(( $major_python_version < 3 )) )); then |
| 95 | + echo "needs_importlib_metadata=true" >> $GITHUB_ENV |
| 96 | + else |
| 97 | + echo "needs_importlib_metadata=false" >> $GITHUB_ENV |
| 98 | + fi |
| 99 | +
|
| 100 | + - name: "Install importlib-metadata (only for Python <= 3.7)" |
| 101 | + if: env.needs_importlib_metadata == 'true' |
| 102 | + shell: bash |
| 103 | + run: | |
| 104 | + python -m pip install importlib-metadata |
| 105 | +
|
| 106 | + - name: "Verify pyaedt is properly installed and get its version number" |
| 107 | + shell: bash |
| 108 | + run: | |
| 109 | + if [ ${{ env.needs_importlib_metadata }} == 'true' ]; then |
| 110 | + version=$(python -c "import importlib_metadata; print(importlib_metadata.version('pyaedt'))") |
| 111 | + else |
| 112 | + version=$(python -c "import importlib.metadata as importlib_metadata; print(importlib_metadata.version('pyaedt'))") |
| 113 | + fi |
| 114 | +
|
| 115 | + if [ -z "$version" ]; then |
| 116 | + echo "Problem getting the library version" |
| 117 | + exit 1; |
| 118 | + else |
| 119 | + echo "The library version is: $version"; |
| 120 | + fi; |
| 121 | + echo "library_version=$version" >> $GITHUB_ENV |
| 122 | +
|
58 | 123 | doc-build:
|
59 | 124 | name: Documentation build without examples
|
60 | 125 | runs-on: ubuntu-latest
|
|
0 commit comments