-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc321ec
commit fa745d0
Showing
3 changed files
with
116 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
name: CI Nightly | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: # UTC at 0300 | ||
- cron: "0 3 * * *" | ||
|
||
env: | ||
MAIN_PYTHON_VERSION: '3.10' | ||
PYMECHANICAL_PORT: 10000 # default won't work on GitHub runners | ||
PYMECHANICAL_START_INSTANCE: FALSE | ||
DOCKER_PACKAGE: ghcr.io/ansys/mechanical | ||
DOCKER_IMAGE_VERSION: 24.2.0 | ||
DOCKER_MECH_CONTAINER_NAME: mechanical | ||
PACKAGE_NAME: ansys-mechanical-core | ||
PACKAGE_NAMESPACE: ansys.mechanical.core | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
packages: read | ||
|
||
jobs: | ||
|
||
nightly-doc-build: | ||
name: Documentation building | ||
runs-on: public-ubuntu-latest-8-cores | ||
outputs: | ||
docker_info: ${{ steps.capture_info.outputs.docker_info }} | ||
build_info: ${{ steps.capture_info.outputs.build_info }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
- name: Install system dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y nodejs npm graphviz | ||
npm install -g @mermaid-js/mermaid-cli | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip tox | ||
- name: Login in Github Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Pull, launch, and validate Mechanical service | ||
env: | ||
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }} | ||
MECHANICAL_IMAGE: ${{ env.DOCKER_PACKAGE }}:${{ env.DOCKER_IMAGE_VERSION }} | ||
id: capture_info | ||
run: | | ||
echo CPU info | ||
lscpu | ||
docker pull ${{ env.MECHANICAL_IMAGE }} | ||
BUILD_DATE=$(docker run --rm --entrypoint head ${{ env.MECHANICAL_IMAGE }} -n 1 /install/ansys_inc/v242/aisol/CommonFiles/builddate.txt) | ||
docker run --restart always --name ${{ env.DOCKER_MECH_CONTAINER_NAME }} -e ANSYSLMD_LICENSE_FILE=1055@${{ env.LICENSE_SERVER }} -p ${{ env.PYMECHANICAL_PORT }}:10000 ${{ env.MECHANICAL_IMAGE }} > log.txt & | ||
grep -q 'WB Initialize Done' <(timeout 60 tail -f log.txt) | ||
PUSHED_AT=$(docker inspect --format='{{.Created}}' ${{ env.MECHANICAL_IMAGE }}) | ||
echo "::group::Docker Info" | ||
echo "docker_info=$PUSHED_AT" >> $GITHUB_OUTPUT | ||
echo "build_info=$BUILD_DATE" >> $GITHUB_OUTPUT | ||
echo "${{ env.DOCKER_IMAGE_VERSION }} pushed at $PUSHED_AT" | ||
echo "Build date : $BUILD_DATE" | ||
echo "::endgroup::" | ||
- name: Build HTML documentation | ||
run: tox -e doc | ||
|
||
- name: Upload HTML documentation | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: HTML-Documentation | ||
path: .tox/doc_out_html/ | ||
retention-days: 7 | ||
|
||
- name: Get Mechanical container logs | ||
if: always() | ||
run: docker logs ${{ env.DOCKER_MECH_CONTAINER_NAME }} > mechanical_documentation_log.txt 2>&1 | ||
|
||
- name: Upload container logs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: mechanical_documentation_log | ||
path: mechanical_documentation_log.txt | ||
retention-days: 7 | ||
|
||
build-failure: | ||
name: Teams notify on failure | ||
if: failure() | ||
needs: [ 'nightly-doc-build'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Microsoft Teams Notification | ||
uses: jdcargile/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }} | ||
notification-summary: Nightly build failure on ${{ env.MECHANICAL_IMAGE }} build at ${{ needs.nightly-doc-build.outputs.build_info }} , pushed at ${{ needs.nightly-doc-build.outputs.docker_info }} (UTC) | ||
notification-color: dc3545 | ||
timezone: America/Chicago |
This file contains 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