diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index cc1279e37ca..fef6cf48872 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -23,28 +23,27 @@ concurrency: cancel-in-progress: true jobs: - style: - name: Code style + + code-style: + name: "Code style" runs-on: ubuntu-latest steps: - - name: PyAnsys code style checks - uses: ansys/actions/code-style@v4 + - uses: ansys/actions/code-style@v4 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} - docs-style: - name: Documentation Style Check + doc-style: + name: "Doc style" runs-on: ubuntu-latest steps: - - name: PyAnsys documentation style checks - uses: ansys/actions/doc-style@v4 + - uses: ansys/actions/doc-style@v4 with: token: ${{ secrets.GITHUB_TOKEN }} smoke-tests: - name: Build and Smoke tests + name: "Wheelhouse for ${{ matrix.os }} and {{ matrix.python-version }}" runs-on: ${{ matrix.os }} - needs: [style] + needs: code-style strategy: fail-fast: false matrix: @@ -64,11 +63,20 @@ jobs: operating-system: ${{ matrix.os }} python-version: ${{ matrix.python-version }} - build_and_test: - name: Build & test + tests: + name: "Test ${{ matrix.python-version }} with ${{ matrix.os }}" needs: [smoke-tests] - runs-on: ubuntu-latest - + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ['3.8', '3.9', '3.10', '3.11'] + should-release: + - ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }} + exclude: + - should-release: false + os: macos-latest steps: - name: Login to GitHub Container Registry uses: docker/login-action@v2 @@ -85,16 +93,16 @@ jobs: env: ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} + python-version: ${{ matrix.os }} requires-xvfb: true - uses: codecov/codecov-action@v3 name: 'Upload coverage to CodeCov' - docs: - name: Build docs + doc: + name: "Doc build" runs-on: ubuntu-latest - needs: [smoke-tests] + needs: doc-style steps: - uses: actions/checkout@v3 @@ -115,13 +123,12 @@ jobs: with: sphinxopts: '-j auto' - package: - name: Package library - needs: [build_and_test, docs] + build-library: + name: "Build library" + needs: [doc, tests] runs-on: ubuntu-latest steps: - - name: Build library source and wheel artifacts - uses: ansys/actions/build-library@v4 + - uses: ansys/actions/build-library@v4 with: library-name: ${{ env.PACKAGE_NAME }} python-version: ${{ env.MAIN_PYTHON_VERSION }} @@ -130,7 +137,7 @@ jobs: name: "Deploy development documentation" # Deploy development only when merging to main if: github.ref == 'refs/heads/main' - needs: [package] + needs: build-library runs-on: ubuntu-latest steps: - name: "Deploy the latest documentation" @@ -142,7 +149,7 @@ jobs: release: name: Release if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - needs: [package] + needs: build-library runs-on: ubuntu-latest steps: # Upload first to the private PyPi, at least up until we release @@ -169,7 +176,7 @@ jobs: # Deploy release documentation when creating a new tag if: github.event_name == 'push' && contains(github.ref, 'refs/tags') runs-on: ubuntu-latest - needs: [package] + needs: release steps: - name: "Deploy the stable documentation" uses: ansys/actions/doc-deploy-stable@v4 @@ -180,7 +187,7 @@ jobs: build-failure: name: Teams notify on failure if: failure() && (github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref_type == 'tag') - needs: [smoke-tests, build_and_test ] + needs: tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v2