From 26d33c693b795c2e2f144de5d809cfb1e5a58331 Mon Sep 17 00:00:00 2001 From: liamhuber Date: Mon, 8 May 2023 16:13:45 -0700 Subject: [PATCH] Exchange workflows for those from pyiron_module_contrib using pyiron/actions --- .github/workflows/UpdateDependabotPR.yml | 30 --------------- .github/workflows/coverage.yml | 46 ----------------------- .github/workflows/daily.yml | 12 ++++++ .github/workflows/dependabot-pr.yml | 10 +++++ .github/workflows/deploy.yml | 32 ---------------- .github/workflows/docs.yml | 38 ------------------- .github/workflows/notebooks.yml | 20 ---------- .github/workflows/pr-labeled.yml | 12 ++++++ .github/workflows/pr-target-opened.yml | 12 ++++++ .github/workflows/push-pull-main.yml | 14 +++++++ .github/workflows/pypicheck.yml | 27 ------------- .github/workflows/release.yml | 11 ++++++ .github/workflows/unittests.yml | 48 ------------------------ .github/workflows/weekly.yml | 12 ++++++ 14 files changed, 83 insertions(+), 241 deletions(-) delete mode 100644 .github/workflows/UpdateDependabotPR.yml delete mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/daily.yml create mode 100644 .github/workflows/dependabot-pr.yml delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/notebooks.yml create mode 100644 .github/workflows/pr-labeled.yml create mode 100644 .github/workflows/pr-target-opened.yml create mode 100644 .github/workflows/push-pull-main.yml delete mode 100644 .github/workflows/pypicheck.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/unittests.yml create mode 100644 .github/workflows/weekly.yml diff --git a/.github/workflows/UpdateDependabotPR.yml b/.github/workflows/UpdateDependabotPR.yml deleted file mode 100644 index b3971e999..000000000 --- a/.github/workflows/UpdateDependabotPR.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: UpdateDependabotPR - -on: - pull_request_target: - branches: [ main ] - -jobs: - build: - runs-on: ubuntu-latest - if: (github.actor == 'dependabot[bot]') - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.ref }} # Check out the head of the actual branch, not the PR - fetch-depth: 0 # otherwise, you will fail to push refs to dest repo - token: ${{ secrets.DEPENDABOT_WORKFLOW_TOKEN }} - - name: UpdateEnvironmentFile - shell: bash -l {0} - run: | - python .ci_support/update_environment.py ${{ github.event.pull_request.title }} - - name: UpdateDependabotPR commit - run: | - git config --local user.email "pyiron@mpie.de" - git config --local user.name "pyiron-runner" - git commit -m "[dependabot skip] Update environment" -a - - name: UpdateDependabotPR push - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.DEPENDABOT_WORKFLOW_TOKEN }} - branch: ${{ github.event.pull_request.head.ref }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index c16d1c248..000000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,46 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Coverage - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} - CONDA_PREFIX: /usr/share/miniconda/ - - steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2.2.0 - with: - python-version: "3.10" - mamba-version: "*" - channels: conda-forge - channel-priority: strict - auto-update-conda: true - environment-file: .ci_support/environment.yml - miniforge-variant: Mambaforge - - name: Setup - shell: bash -l {0} - run: | - python .ci_support/pyironconfig.py - pip install --no-deps . - - name: Test - shell: bash -l {0} - run: | - coverage run --omit pyiron_contrib/_version.py -m unittest discover tests - - name: Coverage - shell: bash -l {0} - run: | - coveralls - coverage xml - python-codacy-coverage -r coverage.xml diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml new file mode 100644 index 000000000..6fed36c31 --- /dev/null +++ b/.github/workflows/daily.yml @@ -0,0 +1,12 @@ +# This runs cron jobs daily + +name: Daily + +on: + schedule: + - cron: '0 23 * * *' + +jobs: + codeql: + uses: pyiron/actions/.github/workflows/tests-and-coverage.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dependabot-pr.yml b/.github/workflows/dependabot-pr.yml new file mode 100644 index 000000000..1ec644549 --- /dev/null +++ b/.github/workflows/dependabot-pr.yml @@ -0,0 +1,10 @@ +name: UpdateDependabotPR + +on: + pull_request_target: + branches: [ main ] + +jobs: + pyiron: + uses: pyiron/actions/.github/workflows/dependabot-pr.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 363867d7b..000000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: PyPi Release - -on: - push: - pull_request: - -# based on https://github.com/pypa/gh-action-pypi-publish -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install dependencies - run: >- - python -m pip install --user --upgrade setuptools wheel - - name: Convert dependencies - run: >- - sed -i 's/==/>=/g' setup.py; cat setup.py - - name: Build - run: >- - python setup.py sdist bdist_wheel - - name: Publish distribution 📦 to PyPI - if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_password }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index a24048d4b..000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow is used to test, if the documentation can build - -name: Docs - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2.2.0 - with: - python-version: "3.10" - mamba-version: "*" - channels: conda-forge - channel-priority: strict - auto-update-conda: true - environment-file: .ci_support/environment.yml - miniforge-variant: Mambaforge - - name: Setup - shell: bash -l {0} - run: | - python .ci_support/pyironconfig.py - pip install --no-deps . - conda env update --name test --file docs/environment.yml - - name: Documentation - shell: bash -l {0} - run: | - mkdir public_html; cd docs - sphinx-build -b html ./ ../public_html || exit 1; - cd .. diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml deleted file mode 100644 index d2a164114..000000000 --- a/.github/workflows/notebooks.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Notebooks - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build-notebooks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: pyiron/actions/build-notebooks@main - with: - python-version: '3.10' - env-prefix: /usr/share/miniconda3/envs/my-env - env-label: linux-64-py-3-10 - env-files: .ci_support/environment.yml .ci_support/environment-notebooks.yml - exclusion-file: .ci_support/exclude \ No newline at end of file diff --git a/.github/workflows/pr-labeled.yml b/.github/workflows/pr-labeled.yml new file mode 100644 index 000000000..4d5e8aa2b --- /dev/null +++ b/.github/workflows/pr-labeled.yml @@ -0,0 +1,12 @@ +# This runs jobs which pyiron modules should run when a PR is labeled + +name: PR labeled + +on: + pull_request: + types: [labeled] + +jobs: + pyiron: + uses: pyiron/actions/.github/workflows/pr-labeled.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/pr-target-opened.yml b/.github/workflows/pr-target-opened.yml new file mode 100644 index 000000000..afdda9d1a --- /dev/null +++ b/.github/workflows/pr-target-opened.yml @@ -0,0 +1,12 @@ +# This runs jobs which pyiron modules should run when a PR target is opened + +name: PR opened + +on: + pull_request_target: + types: [opened] + +jobs: + pyiron: + uses: pyiron/actions/.github/workflows/pr-target-opened.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/push-pull-main.yml b/.github/workflows/push-pull-main.yml new file mode 100644 index 000000000..0ce15dab2 --- /dev/null +++ b/.github/workflows/push-pull-main.yml @@ -0,0 +1,14 @@ +# This runs jobs which pyiron modules should run on pushes or PRs to main + +name: Push-Pull-main + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + pyiron: + uses: pyiron/actions/.github/workflows/push-pull-main.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/pypicheck.yml b/.github/workflows/pypicheck.yml deleted file mode 100644 index 9e8f1ad88..000000000 --- a/.github/workflows/pypicheck.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Pip check - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2.2.0 - with: - python-version: "3.10" - mamba-version: "*" - channels: conda-forge - channel-priority: strict - auto-update-conda: true - environment-file: .ci_support/environment.yml - miniforge-variant: Mambaforge - - name: Setup - shell: bash -l {0} - run: | - pip install --no-deps . - pip check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..6212781ca --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,11 @@ +# This runs jobs which pyiron modules should run on release +name: Release + +on: + release: + types: [ published ] + +jobs: + pyiron: + uses: pyiron/actions/.github/workflows/release.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml deleted file mode 100644 index 5a4d109d5..000000000 --- a/.github/workflows/unittests.yml +++ /dev/null @@ -1,48 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Unit Tests -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ${{ matrix.operating-system }} - strategy: - matrix: - include: - - operating-system: ubuntu-latest - python-version: '3.10' - label: linux-64-py-3-10 - prefix: /usr/share/miniconda3/envs/my-env - - - operating-system: ubuntu-latest - python-version: 3.9 - label: linux-64-py-3-9 - prefix: /usr/share/miniconda3/envs/my-env - - - operating-system: ubuntu-latest - python-version: 3.8 - label: linux-64-py-3-8 - prefix: /usr/share/miniconda3/envs/my-env - - steps: - - uses: actions/checkout@v2 - - uses: pyiron/actions/cached-mamba@main - with: - python-version: ${{ matrix.python-version }} - env-prefix: ${{ matrix.prefix }} - env-label: ${{ matrix.label }} - env-files: .ci_support/environment.yml - - name: Setup - shell: bash -l {0} - run: | - python .ci_support/pyironconfig.py - pip install --no-deps . - - name: Test - shell: bash -l {0} - run: coverage run --omit pyiron_contrib/_version.py -m unittest discover tests diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml new file mode 100644 index 000000000..eb67b8790 --- /dev/null +++ b/.github/workflows/weekly.yml @@ -0,0 +1,12 @@ +# This runs cron jobs weekly + +name: Weekly + +on: + schedule: + - cron: '0 23 * * 2' + +jobs: + codeql: + uses: pyiron/actions/.github/workflows/codeql.yml@main + secrets: inherit \ No newline at end of file