ci(csubst): add smoke-test workflow and scripts #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: csubst ci | |
| on: | |
| push: | |
| branches: [ "**" ] | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: csubst-ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| smoke: | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| python: ['3.9', '3.10', '3.11', '3.12'] | |
| install: [source] # bioconda は後で復活可 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up micromamba | |
| uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| environment-name: csubst-smoke | |
| create-args: >- | |
| python=${{ matrix.python }} | |
| iqtree numpy scipy cython biopython requests pip | |
| condarc: | | |
| channels: | |
| - conda-forge | |
| - bioconda | |
| - defaults | |
| channel_priority: strict | |
| cache-environment: true | |
| cache-downloads: true | |
| # ← 追加:post の ENOENT / “not find … in .bash_profile” 回避 | |
| - name: Workaround micromamba post-step quirks | |
| if: always() | |
| run: | | |
| # post が探す一時ファイルを用意 | |
| mkdir -p "$RUNNER_TEMP/setup-micromamba" | |
| : > "$RUNNER_TEMP/setup-micromamba/micromamba-shell" | |
| # post が .bash_profile から消そうとする行をダミーで用意 | |
| touch "$HOME/.bash_profile" | |
| grep -q 'micromamba activate csubst-smoke' "$HOME/.bash_profile" \ | |
| || echo 'micromamba activate csubst-smoke' >> "$HOME/.bash_profile" | |
| # ← 追加: pyvolve は pip から入れる | |
| - name: Install pyvolve (pip) | |
| shell: bash -l {0} | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --no-input pyvolve==1.1.0 | |
| - name: Install runtime deps | |
| shell: bash -l {0} | |
| run: | | |
| micromamba install -y \ | |
| numpy=1.26.* cython=0.29.* iqtree \ | |
| conda-forge::biopython conda-forge::requests \ | |
| - name: Install csubst (from source) | |
| if: matrix.install == 'source' | |
| shell: bash -l {0} | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --no-build-isolation . | |
| # --- Smoke --- | |
| - name: Run smoke test | |
| shell: bash -l {0} | |
| run: bash ci/csubst_smoke.sh | |
| # --- CLI tests --- | |
| - name: Run CLI tests | |
| shell: bash -l {0} | |
| run: bash ci/csubst_cli.sh | |
| - name: Upload artifacts (always) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: smoke-and-cli-${{ matrix.os }}-${{ matrix.install }} | |
| path: | | |
| $RUNNER_TEMP/csubst_smoke/_artifacts* | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| - name: Run command tests | |
| shell: bash -l {0} | |
| env: | |
| MPLBACKEND: Agg | |
| run: bash ci/csubst_commands.sh | |
| - name: Validate outputs (schema-lite) | |
| shell: bash -l {0} | |
| run: python ci/check_csubst_outputs.py |