Skip to content

Commit

Permalink
CI: Remove needless jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed Nov 28, 2024
1 parent e3fb04d commit 10cd62a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 141 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:

tests:

needs: [check-requirements]

runs-on: ubuntu-latest
timeout-minutes: 45

Expand Down Expand Up @@ -88,7 +86,6 @@ jobs:

tests-presto:

needs: [check-requirements]
runs-on: ubuntu-latest
timeout-minutes: 20

Expand All @@ -114,7 +111,6 @@ jobs:

verdi:

needs: [check-requirements]
runs-on: ubuntu-latest
timeout-minutes: 10

Expand Down
138 changes: 1 addition & 137 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
paths:
- environment.yml
- '**/requirements*.txt'
- pyproject.toml
- util/dependency_management.py
- .github/workflows/test-install.yml
Expand All @@ -14,7 +13,7 @@ on:

# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Expand Down Expand Up @@ -49,32 +48,6 @@ jobs:
- name: Validate conda environment file
run: python ./utils/dependency_management.py validate-environment-yml

resolve-pip-dependencies:
# Check whether the environments defined in the requirements/* files are
# resolvable.

needs: [validate-dependency-specification]
if: github.repository == 'aiidateam/aiida-core'
runs-on: ubuntu-latest
timeout-minutes: 5

strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Resolve dependencies from requirements file.
run: |
pip install --dry-run --ignore-installed -r requirements/requirements-py-${{ matrix.python-version }}.txt
create-conda-environment:
# Verify that we can create a valid conda environment from the environment.yml file.

Expand Down Expand Up @@ -236,112 +209,3 @@ jobs:
AIIDA_TEST_PROFILE: test_aiida
AIIDA_WARN_v3: 1
run: pytest --db-backend psql tests -m 'not nightly' tests/

- name: Freeze test environment
run: pip freeze | sed '1d' | tee requirements-py-${{ matrix.python-version }}.txt

# Add python-version specific requirements/ file to the requirements.txt artifact.
# This artifact can be used in the next step to automatically create a pull request
# updating the requirements (in case they are inconsistent with the pyproject.toml file).
- uses: actions/upload-artifact@v4
with:
name: requirements-py-${{ matrix.python-version }}.txt
path: requirements-py-${{ matrix.python-version }}.txt

# Check whether the requirements/ files are consistent with the dependency specification in the pyproject.toml file.
# If the check fails, warn the user via a comment and try to automatically create a pull request to update the files
# (does not work on pull requests from forks).

check-requirements:

needs: tests

runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Install utils/ dependencies
run: pip install -r utils/requirements.txt

- name: Check consistency of requirements/ files
id: check_reqs
continue-on-error: true
run: python ./utils/dependency_management.py check-requirements DEFAULT --no-github-annotate

#
# The following steps are only executed if the consistency check failed.
#
- name: Create commit comment
if: steps.check_reqs.outcome == 'Failure' # only run if requirements/ are inconsistent
uses: peter-evans/commit-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: pyproject.toml
body: |
The requirements/ files are inconsistent!
# Check out the base branch so that we can prepare the pull request.
- name: Checkout base branch
if: steps.check_reqs.outcome == 'Failure' # only run if requirements/ are inconsistent
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
clean: true

- name: Download requirements.txt files
if: steps.check_reqs.outcome == 'Failure' # only run if requirements/ are inconsistent
uses: actions/download-artifact@v4
with:
pattern: requirements-py-*
merge-multiple: true
path: requirements

- name: Commit requirements files
if: steps.check_reqs.outcome == 'Failure' # only run if requirements/ are inconsistent
run: |
git add requirements/*
- name: Create pull request for updated requirements files
if: steps.check_reqs.outcome == 'Failure' # only run if requirements/ are inconsistent
id: create_update_requirements_pr
continue-on-error: true
uses: peter-evans/create-pull-request@v7
with:
branch: update-requirements
commit-message: Automated update of requirements/ files.
title: Update requirements/ files.
body: |
Update requirements files to ensure that they are consistent
with the dependencies specified in the 'pyproject.toml' file.
Please note, that this pull request was likely created to
resolve the inconsistency for a specific dependency, however
other versions that have changed since the last update will
be included as part of this commit as well.
Click [here](https://github.com/aiidateam/aiida-core/wiki/AiiDA-Dependency-Management) for more information.
- name: Create PR comment on success
if: steps.create_update_requirements_pr.outcome == 'Success'
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.number }}
body: |
I automatically created a pull request (#${{ steps.create_update_requirements_pr.outputs.pr_number }}) that adapts the
requirements/ files according to the dependencies specified in the 'pyproject.toml' file.
- name: Create PR comment on failure
if: steps.create_update_requirements_pr.outcome == 'Failure'
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.number }}
body: |
Please update the requirements/ files to ensure that they
are consistent with the dependencies specified in the 'pyproject.toml' file.

0 comments on commit 10cd62a

Please sign in to comment.