Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 2 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, closed, labeled]
types: [opened, synchronize, reopened, ready_for_review]
branches-ignore:
- '*no-ci*'
push:
Expand Down Expand Up @@ -31,16 +31,14 @@ env:
jobs:
debug:
runs-on: ubuntu-latest
if: github.event.action != 'closed'
steps:
- name: Show the Github context for the triggered event
- name: Show the GitHub context for the triggered event
run: echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}

pick_server_suffix:
runs-on: ubuntu-latest
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
outputs:
suffix: ${{ steps.step1.outputs.suffix }}
steps:
Expand Down Expand Up @@ -71,7 +69,6 @@ jobs:
style:
name: "Style Check"
runs-on: ubuntu-latest
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
steps:
- uses: ansys/actions/code-style@v8
with:
Expand All @@ -80,7 +77,6 @@ jobs:
build_linux1:
name: "Build linux1 wheel"
runs-on: ubuntu-latest
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -111,7 +107,6 @@ jobs:
matrix:
test-any: ['false', 'true']
uses: ./.github/workflows/tests.yml
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
Expand All @@ -126,7 +121,6 @@ jobs:
docker_tests:
name: "Build and Test on Docker"
uses: ./.github/workflows/test_docker.yml
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
Expand All @@ -136,7 +130,6 @@ jobs:
docker_examples:
name: "Run examples on Docker"
uses: ./.github/workflows/examples_docker.yml
if: github.event.action != 'closed' && (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc')
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
Expand All @@ -146,8 +139,6 @@ jobs:

docs:
if: |
github.event.action != 'closed' &&
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
uses: ./.github/workflows/docs.yml
needs: pick_server_suffix
Expand All @@ -158,31 +149,9 @@ jobs:
python_version: "3.11"
secrets: inherit

doc-deploy-pr:
name: "Deploy PR documentation"
runs-on: ubuntu-latest
needs: docs
if: |
always() &&
github.event.pull_request.draft != true &&
(needs.docs.result == 'success' || needs.docs.result == 'skipped') &&
contains(github.event.pull_request.labels.*.name, 'deploy-pr-doc')
steps:
- uses: ansys/actions/doc-deploy-pr@v10
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
decompress-artifact: true
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
maximum-pr-doc-deployments: 10

upload-development-docs:
runs-on: ubuntu-latest
if: |
github.event.action != 'closed' &&
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
(github.ref == 'refs/heads/main' && github.event_name == 'push')
needs: [docs]
steps:
Expand All @@ -198,8 +167,6 @@ jobs:

examples:
if: |
github.event.action != 'closed' &&
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
uses: ./.github/workflows/examples.yml
needs: pick_server_suffix
Expand All @@ -212,8 +179,6 @@ jobs:
pydpf-post:
name: "PyDPF-Post"
if: |
github.event.action != 'closed' &&
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
uses: ./.github/workflows/pydpf-post.yml
needs: pick_server_suffix
Expand All @@ -227,8 +192,6 @@ jobs:
tests-retro:
name: "Test DPF ${{ matrix.version }} compatibility"
if: |
github.event.action != 'closed' &&
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
strategy:
fail-fast: false
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/doc-deploy-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: doc-deploy-PR

on:
workflow_run:
workflows: [docs]
types: [completed]

env:
DOCUMENTATION_CNAME: 'dpf.docs.pyansys.com'

jobs:
debug:
name: debug
runs-on: ubuntu-latest
env:
EVENT_OBJ: ${{ toJson(github.event) }}
steps:
- run: echo $EVENT_OBJ
doc-deploy-pr:
name: "Deploy PR documentation"
runs-on: ubuntu-latest
if: |
github.event.workflow_run.conclusion == 'success' &&
contains(github.event.workflow_run.pull_requests.*.labels.*.name, 'deploy-pr-doc')
steps:
- name: "Download artifacts"
uses: dawidd6/action-download-artifact@v11
with:
workflow: docs.yml
name: HTML-doc-ansys-dpf-core.zip
github_token: ${{ secrets.GITHUB_TOKEN }}
run_id: ${{ github.event.workflow_run.id }}


- name: "Display downloaded files"
run: ls -R

- uses: ansys/actions/doc-deploy-pr@v10
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
decompress-artifact: true
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
maximum-pr-doc-deployments: 10
Comment on lines +1 to +46
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: doc-deploy-PR
on:
workflow_run:
workflows: [docs]
types: [completed]
env:
DOCUMENTATION_CNAME: 'dpf.docs.pyansys.com'
jobs:
debug:
name: debug
runs-on: ubuntu-latest
env:
EVENT_OBJ: ${{ toJson(github.event) }}
steps:
- run: echo $EVENT_OBJ
doc-deploy-pr:
name: "Deploy PR documentation"
runs-on: ubuntu-latest
if: |
github.event.workflow_run.conclusion == 'success' &&
contains(github.event.workflow_run.pull_requests.*.labels.*.name, 'deploy-pr-doc')
steps:
- name: "Download artifacts"
uses: dawidd6/action-download-artifact@v11
with:
workflow: docs.yml
name: HTML-doc-ansys-dpf-core.zip
github_token: ${{ secrets.GITHUB_TOKEN }}
run_id: ${{ github.event.workflow_run.id }}
- name: "Display downloaded files"
run: ls -R
- uses: ansys/actions/doc-deploy-pr@v10
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
decompress-artifact: true
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
maximum-pr-doc-deployments: 10
name: doc-deploy-PR
on:
workflow_run:
workflows: [docs]
types: [completed]
pull_request:
types: [closed]
env:
DOCUMENTATION_CNAME: 'dpf.docs.pyansys.com'
jobs:
debug:
name: debug
runs-on: ubuntu-latest
env:
EVENT_OBJ: ${{ toJson(github.event) }}
steps:
- run: echo $EVENT_OBJ
doc-deploy-pr:
name: "Deploy PR documentation"
runs-on: ubuntu-latest
if: |
(
github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success' &&
contains(github.event.workflow_run.pull_requests.*.labels.*.name, 'deploy-pr-doc')
) || (
github.event_name == 'pull_request' &&
github.event.action == 'closed' &&
contains(github.event.pull_request.labels.*.name, 'deploy-pr-doc')
)
steps:
- name: Set PR number
id: pr
run: |
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
echo "pr_number=${{ fromJson(toJson(github.event.workflow_run.pull_requests[0])).number }}" >> "$GITHUB_OUTPUT"
else
echo "pr_number=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
fi
- name: Print PR number
run: echo "PR number is ${{ steps.pr.outputs.pr_number }}"
- name: Download artifacts (if workflow_run)
if: ${{ github.event_name == 'workflow_run' }}
uses: dawidd6/action-download-artifact@v11
with:
workflow: docs.yml
name: HTML-doc-ansys-dpf-core.zip
github_token: ${{ secrets.GITHUB_TOKEN }}
run_id: ${{ github.event.workflow_run.id }}
- name: Display downloaded files (if workflow_run)
if: ${{ github.event_name == 'workflow_run' }}
run: ls -R
- uses: ansys/actions/doc-deploy-pr@v10
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
decompress-artifact: true
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
maximum-pr-doc-deployments: 10

Loading