diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..ce0d77c8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +--- +version: 2 +updates: +# Maintain dependencies for GitHub Actions + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly + groups: + gha-dependencies: + patterns: + - '*' diff --git a/.github/workflows/ci-nightly.yml b/.github/workflows/ci-nightly.yml deleted file mode 100644 index ededb47b..00000000 --- a/.github/workflows/ci-nightly.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- -# Run basic tests for this app on the latest aiidalab-docker image. - -name: continuous-integration - -on: [push, pull_request] - -jobs: - - pre-commit: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - - name: Install dependencies - run: pip install -U pre-commit==2.10.0 - - - name: Run pre-commit - run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) - - test-nightly: - needs: [pre-commit] - - strategy: - matrix: - python-version: ['3.9'] - - services: - rabbitmq: - image: rabbitmq:3.8.14-management - ports: - - 5672:5672 - - 15672:15672 - - runs-on: ubuntu-latest - timeout-minutes: 40 - - steps: - - uses: eWaterCycle/setup-singularity@v7 # for containerized code test - with: - singularity-version: 3.8.7 - - - uses: actions/checkout@v2 - - - name: Cache Python dependencies - uses: actions/cache@v1 - with: - path: ~/.cache/pip - key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/setup.json') }} - restore-keys: pip-${{ matrix.python-version }}-tests - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies for test - run: | - pip install -U pip==22.3.1 - pip install -U .[tests] - - # - name: Pull the image and Run pytest - # run: | - # singularity run docker://containers4hpc/qe-mpich314:0.1.0 which pw.x - # pytest -v tests/test_nightly.py -s diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46ed2113..df243448 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,66 +1,96 @@ --- # Run basic tests for this app on the latest aiidalab-docker image. -name: continuous-integration +name: CI unit test on: [push, pull_request] jobs: - pre-commit: + fast-tests: + runs-on: ubuntu-latest + timeout-minutes: 10 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v5 with: - python-version: '3.10' - - - name: Install dependencies - run: pip install -U pre-commit==2.10.0 + python-version: "3.10" - - name: Run pre-commit - run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) + - name: Install uv + run: | + curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.2.4/uv-installer.sh | sh - test: - needs: [pre-commit] + - name: Install dependencies for test + run: | + uv pip install .[dev] - strategy: - matrix: - python-version: ['3.9', '3.10'] + - name: Pull the image and Run pytest + run: | + pytest -v tests -m "not slow" - services: - rabbitmq: - image: rabbitmq:3.8.14-management - ports: - - 5672:5672 - - 15672:15672 + slow-tests: + needs: [fast-tests] runs-on: ubuntu-latest - timeout-minutes: 40 + timeout-minutes: 30 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Cache Python dependencies - uses: actions/cache@v1 + - name: Set up Python 3.10 + uses: actions/setup-python@v5 with: - path: ~/.cache/pip - key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/setup.json') }} - restore-keys: pip-${{ matrix.python-version }}-tests + python-version: "3.10" - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} + - name: Install uv + run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.2.4/uv-installer.sh | sh - name: Install dependencies for test run: | - pip install -U pip==22.3.1 - pip install -U .[tests] + uv pip install .[dev] + + - name: Pull the image and Run pytest + run: | + pytest -v tests -m "slow" + + edge-aiida-core-tests: + # This is to test the plugin is compatible with the main branch of aiida-core + + needs: [slow-tests] + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install uv + run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.2.4/uv-installer.sh | sh + + - name: Install dependencies and edge aiida-core for test + run: | + uv pip install .[dev] + pip uninstall --yes aiida-core + git clone --depth 1 https://github.com/aiidateam/aiida-core.git + uv pip install ./aiida-core + + - name: Check aiida-core version is the edget ('post' in version tag) + run: | + if verdi --version | grep -q "post"; then + echo $(verdi --version) + else + echo $(verdi --version) + exit 1 + fi - name: Pull the image and Run pytest run: | - pytest -sv tests + pytest -v tests diff --git a/src/aiida_sssp_workflow/workflows/measure/transferability.py b/src/aiida_sssp_workflow/workflows/measure/transferability.py index e70cd669..72e51262 100644 --- a/src/aiida_sssp_workflow/workflows/measure/transferability.py +++ b/src/aiida_sssp_workflow/workflows/measure/transferability.py @@ -340,6 +340,7 @@ def prepare_evaluate_builder( builder = self._EVALUATE_WORKCHAIN.get_builder() + builder.metadata.call_link_label = f"{configuration}" builder.clean_workdir = ( self.inputs.clean_workdir ) # sync with the main workchain diff --git a/tests/conftest.py b/tests/conftest.py index 4c753f65..7cd1d2a6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -48,7 +48,7 @@ def _code_generator(bin): label=f"{bin}-docker", default_calc_job_plugin=plugin, filepath_executable=exec_path, - image_name="ghcr.io/containers4hpc/quantum-espresso:v2024.1001", + image_name="ghcr.io/cnts4sci/quantum-espresso:edge", wrap_cmdline_params=True, engine_command=engine_command, use_double_quotes=True, diff --git a/tests/workflows/convergence/test_base/test_run_default_sssp_workflow_convergence_bands_.yml b/tests/workflows/convergence/test_base/test_run_default_sssp_workflow_convergence_bands_.yml index f23de268..f5daf585 100644 --- a/tests/workflows/convergence/test_base/test_run_default_sssp_workflow_convergence_bands_.yml +++ b/tests/workflows/convergence/test_base/test_run_default_sssp_workflow_convergence_bands_.yml @@ -19,7 +19,7 @@ bands: Al: Al clean_workdir: true fermi_shift: 10.0 -init_nbands_factor: 3.0 +init_nbands_factor: 3 kpoints_distance_bands: 0.5 run_band_structure: false scf: diff --git a/tests/workflows/measure/test_transferability.py b/tests/workflows/measure/test_transferability.py index e60281da..66c3605b 100644 --- a/tests/workflows/measure/test_transferability.py +++ b/tests/workflows/measure/test_transferability.py @@ -42,13 +42,15 @@ def test_run_default_check_inner_eos_inputs( assert "test" in node.description # Check the first EOS (SC) use (25, 100) cutoffs - pw_parameters_SC = node.called[2].inputs.eos.pw.parameters + + outgoing: orm.LinkManager = node.base.links.get_outgoing() + pw_parameters_SC = outgoing.get_node_by_label("SC").inputs.eos.pw.parameters assert isinstance(pw_parameters_SC["SYSTEM"]["ecutwfc"], int) assert pw_parameters_SC["SYSTEM"]["ecutwfc"] == 25 assert pw_parameters_SC["SYSTEM"]["ecutrho"] == 100 - # Check the first EOS (XO) use (30, 120) cutoffs - pw_parameters_XO = node.called[3].inputs.eos.pw.parameters + # Check the first EOS (XO) use (30, 120) cutoffs from Oxygen + pw_parameters_XO = outgoing.get_node_by_label("XO").inputs.eos.pw.parameters assert isinstance(pw_parameters_XO["SYSTEM"]["ecutwfc"], int) assert pw_parameters_XO["SYSTEM"]["ecutwfc"] == 30 assert pw_parameters_XO["SYSTEM"]["ecutrho"] == 120