Compute IDT and IDT SA using Cantera #72
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: T3 CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened] | |
| schedule: | |
| - cron: '0 0 * * *' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint (ruff) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/ruff-action@v3 | |
| with: | |
| args: "check ." | |
| build-and-test: | |
| name: Build and Test T3 | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| steps: | |
| # 1. Checkout T3 (The repo running this CI) | |
| - name: Checkout T3 | |
| uses: actions/checkout@v6 | |
| with: | |
| path: T3 | |
| # 2. Checkout ARC (Dependency) | |
| - name: Checkout ARC | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ReactionMechanismGenerator/ARC | |
| ref: linear_ts | |
| path: ARC | |
| # 3. Checkout RMG Database | |
| - name: Checkout RMG Database | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ReactionMechanismGenerator/RMG-database | |
| path: RMG-database | |
| ref: main | |
| fetch-depth: 1 | |
| # 4. Checkout RMG-Py (needed at runtime for the rmg_env subprocess) | |
| - name: Checkout RMG-Py | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ReactionMechanismGenerator/RMG-Py | |
| path: RMG-Py | |
| ref: xTB | |
| fetch-depth: 1 | |
| # 5. Clean Disk (Important for heavy conda envs) | |
| - name: Clean Ubuntu Image | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| tool-cache: true | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: true | |
| swap-storage: true | |
| # 6. Setup T3 Environment | |
| - name: Set up micromamba (t3_env) | |
| uses: mamba-org/setup-micromamba@v3 | |
| with: | |
| environment-name: t3_env | |
| environment-file: T3/environment.yml | |
| cache-environment: true | |
| generate-run-shell: true | |
| # 7. Setup RMG Environment (rmg_env) — required by all T3 tests that | |
| - name: Set up micromamba (rmg_env) | |
| uses: mamba-org/setup-micromamba@v3 | |
| with: | |
| environment-name: rmg_env | |
| environment-file: RMG-Py/environment.yml | |
| cache-environment: true | |
| generate-run-shell: false | |
| create-args: >- | |
| python=3.11 | |
| --channel-priority strict | |
| # 8. Compile RMG-Py (Cython extensions, in rmg_env) | |
| - name: Compile RMG-Py | |
| shell: bash -el {0} | |
| working-directory: RMG-Py | |
| run: | | |
| micromamba run -n rmg_env make | |
| echo "PYTHONPATH=${{ github.workspace }}/RMG-Py" >> $GITHUB_ENV | |
| # 9. Install & Compile ARC (Dependency, into t3_env) | |
| - name: Install and Compile ARC | |
| shell: micromamba-shell {0} | |
| working-directory: ARC | |
| run: | | |
| echo "::group::Install PyRDL (The ARC Way)" | |
| bash devtools/install_pyrdl.sh t3_env | |
| echo "::endgroup::" | |
| echo "::group::Compile ARC extensions" | |
| make compile | |
| echo "::endgroup::" | |
| echo "::group::Install ARC in editable mode" | |
| pip install -e . | |
| echo "::endgroup::" | |
| # 9b. Install xTB into its own xtb_env (used by ARC for gfn2 jobs) | |
| - name: Install xTB | |
| shell: bash -el {0} | |
| working-directory: ARC | |
| run: bash devtools/install_xtb.sh | |
| # 10. Install T3 (Self) | |
| - name: Install T3 | |
| shell: micromamba-shell {0} | |
| working-directory: T3 | |
| run: | | |
| pip install -e . | |
| # 11. Run T3 Tests | |
| - name: Run Tests | |
| shell: micromamba-shell {0} | |
| working-directory: T3 | |
| run: | | |
| echo "Running T3 Tests..." | |
| export PYTHONPATH="$PYTHONPATH:$(pwd):${{ github.workspace }}/ARC:${{ github.workspace }}/RMG-Py" | |
| export RMG_DB_PATH="${{ github.workspace }}/RMG-database" | |
| # Run pytest on the T3 tests directory | |
| pytest tests/ --cov=t3 --cov-report=xml -ra -vv | |
| # 9. Upload Coverage | |
| - name: Upload coverage data | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: T3/coverage.xml | |
| flags: unittests | |
| name: codecov-t3 | |
| fail_ci_if_error: false |