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 73f8a01cf..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' @@ -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"} @@ -52,12 +53,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 @@ -68,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 @@ -84,8 +113,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 @@ -94,35 +123,8 @@ jobs: report_paths: '**/test*.xml' check_name: End-to-end Test Report - docs: - name: Documentation - runs-on: ubuntu-latest - # needs: docs-style - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ env.DOC_PYTHON_VERSION }} - - name: Install dependencies - 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 + name: Build wheel runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -136,14 +138,6 @@ jobs: 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: @@ -152,3 +146,24 @@ jobs: dist/*.whl retention-days: 5 + docs: + name: Documentation + runs-on: ubuntu-latest + # needs: docs-style + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ env.DOC_PYTHON_VERSION }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools tox + - name: Generate the documentation with tox + 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