From f9045ac644d20b8f4f49e72b30d2ca6b506f7718 Mon Sep 17 00:00:00 2001 From: bottler Date: Wed, 27 Nov 2024 05:58:13 -0800 Subject: [PATCH] Update on "github actions" [ghstack-poisoned] --- .github/check-yaml.py | 7 ++++++ .github/workflows/every_commit.yml | 39 +++++++++--------------------- .github/workflows/version.yml | 19 ++++++--------- 3 files changed, 26 insertions(+), 39 deletions(-) create mode 100644 .github/check-yaml.py diff --git a/.github/check-yaml.py b/.github/check-yaml.py new file mode 100644 index 000000000..df70a2428 --- /dev/null +++ b/.github/check-yaml.py @@ -0,0 +1,7 @@ +import pathlib +import yaml + +for path in pathlib.Path(".").glob("**/*.yml"): + print(path) + with open(path) as f: + yaml.load(f, Loader=yaml.FullLoader) diff --git a/.github/workflows/every_commit.yml b/.github/workflows/every_commit.yml index f6ea96e3e..412aaf05c 100644 --- a/.github/workflows/every_commit.yml +++ b/.github/workflows/every_commit.yml @@ -64,34 +64,17 @@ jobs: #pip install --progress-bar off --use-deprecated=legacy-resolver repo/nevergrad-build/dist/nevergrad-*any.whl echo "Installed wheel" python -c "from nevergrad import functions;f = functions.ArtificialFunction(name='sphere', block_dimension=2);f([2, 3])" - # - uses: actions/upload-artifact@v4.0.0 - # with: - # path: nevergrad-build/dist - # - name: Build docs - # run: | - # . venv/bin/activate - # cd docs/ - # make html - # - uses: actions/upload-artifact@v4.0.0 - # with: - # path: docs/_build/html - # - name: Deploy documentation IF main - # uses: peaceiris/actions-gh-pages@v3 - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - # publish_dir: docs/build/html - # if: github.event_name != 'pull_request' - - name: Build docs - run: | - . venv/bin/activate - cd docs/ - make html - - name: Upload static files as artifact - id: deployment - uses: actions/upload-pages-artifact@v3 - with: - path: docs/_build/html/ - if: github.event_name != 'pull_request' + - name: Build docs + run: | + . venv/bin/activate + cd docs/ + make html + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 + with: + path: docs/_build/html/ + if: github.event_name != 'pull_request' deploy-docs: environment: name: github-pages diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 5490f39bb..0340020db 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -30,18 +30,15 @@ jobs: mv dist nevergrad-build/ - name: Create .pypirc run: | - if [[ $GITHUB_REF =~ ^refs/tags//(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(\.post(0|[1-9][0-9]*))?/$ && $GITHUB_REF != 'refs/heads//.*/' ]]; then - echo -e "[pypi]" >> ~/.pypirc - echo -e "username = __token__" >> ~/.pypirc - echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc - fi + echo -e "[pypi]" >> ~/.pypirc + echo -e "username = __token__" >> ~/.pypirc + echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc - name: Verify tag run: python setup.py verify_circleci_version - name: upload to pypi run: | - echo "Deploying" - . venv/bin/activate - du -h nevergrad-build/dist/* - twine check nevergrad-build/dist/nevergrad-* - twine upload nevergrad-build/dist/nevergrad-* --verbose - fi + echo "Deploying" + . venv/bin/activate + du -h nevergrad-build/dist/* + twine check nevergrad-build/dist/nevergrad-* + twine upload nevergrad-build/dist/nevergrad-* --verbose