diff --git a/.github/workflows/interface.yml b/.github/workflows/interface.yml index d45680dbd57..913a4614a79 100644 --- a/.github/workflows/interface.yml +++ b/.github/workflows/interface.yml @@ -24,6 +24,10 @@ jobs: prefix: Bi2Se3_advanced basis: lcao + defaults: + run: + working-directory: interfaces/Wannier90_interface/examples_python + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -36,7 +40,7 @@ jobs: - name: Install abacusw90 run: | python -m pip install --upgrade pip - pip install -e . + pip install -e .. - name: Confirm no wannier90.x in environment run: | @@ -46,12 +50,6 @@ jobs: fi echo "OK: no wannier90.x (dryrun mode)" - # ================================================================ - # Shared mock + patch - # NOTE: env: MUST be a sibling of run: (same indent level). - # run: uses block scalar literal (|) so the heredoc inside - # is passed to bash with YAML indentation stripped. - # ================================================================ - name: Create mock data & patch script env: SCRIPT: ${{ matrix.script }} @@ -90,11 +88,22 @@ jobs: os.makedirs(d, exist_ok=True) # ── 3. Mock STRU (scf/ + wannier/) ──────────────────── - stru = textwrap.dedent("""\ - ATOMIC_SPECIES - Bi 208.980 Bi.upf - Se 78.960 Se.upf - + if basis == "pw": + atom_species = ( + "ATOMIC_SPECIES\n" + "Bi 208.980 Bi_pbe_fr.upf\n" + "Se 78.960 Bi_pbe_fr.upf\n" + "\n" + ) + else: + atom_species = ( + "ATOMIC_SPECIES\n" + "Bi 208.980 Bi_pbe_fr.upf Bi_gga_10au_100Ry_2s2p2d.orb\n" + "Se 78.960 Bi_pbe_fr.upf Se_gga_10au_100Ry_2s2p2d.orb\n" + "\n" + ) + + lattice_block = textwrap.dedent("""\ LATTICE_CONSTANT 1.0 @@ -115,6 +124,8 @@ jobs: 0.206 0.206 0.118 1 1 1 0.794 0.794 0.882 1 1 1 """) + + stru = atom_species + lattice_block for d in [f"{prefix}/scf", f"{prefix}/wannier"]: p = os.path.join(d, "STRU") with open(p, "w") as f: @@ -161,9 +172,9 @@ jobs: print(f"[mock] {nnkp} ({len(lines)} lines)") # ── 5. Mock PP & ORB files ───────────────────────────── - orb_dir = "tests/PP_ORB/for_interface/Wannier90_interface" + orb_dir = os.path.abspath("../../../tests/PP_ORB/") os.makedirs(orb_dir, exist_ok=True) - for name in ["Bi.upf", "Se.upf", "Bi.orb", "Se.orb"]: + for name in ["Bi_pbe_fr.upf", "Se_pbe_fr.upf", "Bi_gga_10au_100Ry_2s2p2d.orb", "Se_gga_10au_100Ry_2s2p2d.orb"]: p = os.path.join(orb_dir, name) with open(p, "w") as f: f.write("# mock for CI dryrun\n") @@ -172,15 +183,9 @@ jobs: print("\n[done] all mocks ready") PYEOF - # ================================================================ - # Run - # ================================================================ - name: Run ${{ matrix.script }} — dryrun run: python ${{ matrix.script }} 2>&1 | tee run.log - # ================================================================ - # Validate - # ================================================================ - name: Check dryrun completion banner run: | if grep -q "DRY RUN COMPLETE" run.log; then @@ -269,9 +274,6 @@ jobs: echo " ALL CHECKS PASSED (${{ matrix.name }})" echo "==========================================" - # ================================================================ - # Debug (always runs, even on failure) - # ================================================================ - name: Show full script output if: always() run: cat run.log