From 3eb3b1e2f10518e6e19bc2b853768622d9043104 Mon Sep 17 00:00:00 2001 From: Federico Negri Date: Fri, 10 Feb 2023 17:23:18 +0100 Subject: [PATCH 1/4] Update build --- .github/workflows/nightly.yml | 81 ++++++++++++++--------------------- 1 file changed, 33 insertions(+), 48 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 73f8a01cf..cd2f9eecd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -52,12 +52,40 @@ jobs: run: | python -m pip install --upgrade pip setuptools tox tox-gh-actions + - name: Check out rep-deployments + uses: actions/checkout@v3 + with: + repository: ansys/rep-deployments + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + submodules: true + path: rep-deployments + + - uses: KengoTODA/actions-setup-docker-compose@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Login in Github Container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: pyansys-ci-bot + password: ${{ secrets.PYANSYS_CI_BOT_PACKAGE_TOKEN }} + + - name: Start services + run: | + docker-compose pull + LOCALHOST_ADDR=localhost docker-compose up -d keycloak + echo "Waiting a few sec ..." + sleep 5 + LOCALHOST_ADDR=localhost docker-compose up -d + working-directory: ./rep-deployments/docker-compose + - name: Test with tox run: tox -e ${{ matrix.cfg.toxenv }}-noeval-coverage env: - REP_TEST_URL: https://repkube.westeurope.cloudapp.azure.com/dev/rep + REP_TEST_URL: https://localhost:8443/rep REP_TEST_USERNAME: repadmin - REP_TEST_PASSWORD: ${{ secrets.REPADMIN_PASSWORD }} + REP_TEST_PASSWORD: repadmin - name: Publish Test Report uses: mikepenz/action-junit-report@v3 @@ -84,8 +112,8 @@ jobs: run: tox -e py37-witheval env: REP_TEST_URL: https://repkube.westeurope.cloudapp.azure.com/dev/rep - REP_TEST_USERNAME: repadmin - REP_TEST_PASSWORD: ${{ secrets.REPADMIN_PASSWORD }} + REP_TEST_USERNAME: repbuild + REP_TEST_PASSWORD: repbuild - name: Publish Test Report uses: mikepenz/action-junit-report@v3 @@ -108,47 +136,4 @@ jobs: run: | python -m pip install --upgrade pip setuptools tox - name: Generate the documentation with tox - run: tox -e doc - - name: Add gh-pages parameters - run: | - touch build/sphinx/html/.nojekyll - echo "dev.rep.docs.pyansys.com" >> build/sphinx/html/CNAME - - name: Deploy Documentation - if: github.ref == 'refs/heads/main' - uses: JamesIves/github-pages-deploy-action@4.1.4 - with: - branch: gh-pages - folder: build/sphinx/html - clean: true - - build: - name: Build and publish library - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - name: Install dependencies and build the library - run: | - python -m pip install --upgrade pip setuptools - python -m pip install -r requirements/requirements_build.txt - python -m build venv wheel - python -m twine check dist/* - - name: Upload to private PyPi - if: github.ref == 'refs/heads/main' - run: | - python -m twine upload --verbose --skip-existing dist/*.whl - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} - TWINE_REPOSITORY_URL: https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/upload - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: pyrep-package - path: | - dist/*.whl - retention-days: 5 - + run: tox -e doc \ No newline at end of file From 5cc933d3c96bce95dae294b5faf52c4124dd6a6e Mon Sep 17 00:00:00 2001 From: Federico Negri Date: Fri, 10 Feb 2023 17:31:19 +0100 Subject: [PATCH 2/4] Update --- .github/workflows/ci_cd.yml | 2 -- .github/workflows/nightly.yml | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index fb485d858..9f87199e8 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -38,8 +38,6 @@ jobs: name: Quick tests and coverage runs-on: ${{ matrix.os }} strategy: - # max 1 job at a time running against the server to make it more robust - max-parallel: 1 matrix: os: [ubuntu-latest] cfg: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cd2f9eecd..eeaed4c00 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -33,10 +33,11 @@ jobs: name: Quick tests and coverage runs-on: ${{ matrix.os }} strategy: - # max 1 job at a time running against the server to make it more robust - max-parallel: 1 matrix: - os: [windows-latest, ubuntu-latest] + # extend to windows once it's possible to run docker + # on windows runners: + # os: [windows-latest, ubuntu-latest] + os: [ubuntu-latest] cfg: - {python-version: "3.7", toxenv: "py37"} - {python-version: "3.10", toxenv: "py310"} @@ -96,7 +97,7 @@ jobs: end-to-end-tests: name: End-to-end tests - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v3 From e2b88245df9a9622a2043abfc89942d527113aeb Mon Sep 17 00:00:00 2001 From: Federico Negri Date: Fri, 10 Feb 2023 17:35:22 +0100 Subject: [PATCH 3/4] Re-include build wheel step --- .github/workflows/nightly.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index eeaed4c00..ed01b7fc8 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -123,6 +123,29 @@ jobs: report_paths: '**/test*.xml' check_name: End-to-end Test Report + build: + name: Build wheel + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + - name: Install dependencies and build the library + run: | + python -m pip install --upgrade pip setuptools + python -m pip install -r requirements/requirements_build.txt + python -m build venv wheel + python -m twine check dist/* + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: pyrep-package + path: | + dist/*.whl + retention-days: 5 + docs: name: Documentation runs-on: ubuntu-latest From 3ee5eb9214fa227df6f5ea778690e40573e8990c Mon Sep 17 00:00:00 2001 From: Federico Negri Date: Fri, 10 Feb 2023 17:55:00 +0100 Subject: [PATCH 4/4] Upload doc artifact and extend schedule --- .github/workflows/nightly.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ed01b7fc8..baf0fa036 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,7 +2,7 @@ name: Nightly Build on: workflow_dispatch: schedule: - - cron: "0 2 * * 1-5" + - cron: "0 2 * * *" env: MAIN_PYTHON_VERSION: '3.7' @@ -160,4 +160,10 @@ jobs: run: | python -m pip install --upgrade pip setuptools tox - name: Generate the documentation with tox - run: tox -e doc \ No newline at end of file + run: tox -e doc + - name: Upload HTML Documentation + uses: actions/upload-artifact@v2 + with: + name: documentation-html + path: build/sphinx/html + retention-days: 5 \ No newline at end of file