|
| 1 | +# Pure Python CI |
| 2 | +# Runs a reduced set of tests compared to CI.yml, skips CD altogether, ensure pure-python |
| 3 | +# mode (i.e. no Julia-based dependencies) works. |
| 4 | + |
| 5 | +name: Pure Python Continuous Integration |
| 6 | + |
| 7 | +on: |
| 8 | + schedule: |
| 9 | + # * is a special character in YAML so you have to quote this string |
| 10 | + - cron: "0 8 * * *" |
| 11 | + # allow running on RMG-Py on a pushed branch, only if triggered manually |
| 12 | + workflow_dispatch: |
| 13 | + # runs on PRs against RMG-Py (and anywhere else, but we add this for RMG-Py) |
| 14 | + pull_request: |
| 15 | + |
| 16 | +# this prevents one PR from simultaneously running multiple runners, which will clog up the queue |
| 17 | +# and prevent other PRs from running the CI |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +env: |
| 23 | + # if running on RMG-Py but requiring changes on an un-merged branch of RMG-database, replace |
| 24 | + # main with the name of the branch |
| 25 | + RMG_DATABASE_BRANCH: main |
| 26 | + |
| 27 | + |
| 28 | +jobs: |
| 29 | + build-and-test: |
| 30 | + strategy: |
| 31 | + fail-fast: false |
| 32 | + matrix: |
| 33 | + python-version: ["3.9"] |
| 34 | + os: [macos-13, macos-latest, ubuntu-latest] |
| 35 | + runs-on: ${{ matrix.os }} |
| 36 | + name: ${{ matrix.os }} Build and Minimal Test Python ${{ matrix.python-version }} |
| 37 | + # skip scheduled runs from forks |
| 38 | + if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }} |
| 39 | + defaults: |
| 40 | + run: |
| 41 | + shell: bash -l {0} |
| 42 | + steps: |
| 43 | + - name: Checkout RMG-Py |
| 44 | + uses: actions/checkout@v4 |
| 45 | + |
| 46 | + - name: Compel Arm-based Mac to use x86 |
| 47 | + if: matrix.os == 'macos-latest' |
| 48 | + run: echo "CONDA_SUBDIR=osx-64" >> $GITHUB_ENV |
| 49 | + |
| 50 | + - name: Setup Miniforge Python ${{ matrix.python-version }} |
| 51 | + uses: conda-incubator/setup-miniconda@v3 |
| 52 | + with: |
| 53 | + environment-file: environment.yml |
| 54 | + miniforge-variant: Miniforge3 |
| 55 | + miniforge-version: latest |
| 56 | + python-version: ${{ matrix.python-version }} |
| 57 | + activate-environment: rmg_env |
| 58 | + use-mamba: true |
| 59 | + show-channel-urls: true |
| 60 | + channels: conda-forge,cantera,rmg |
| 61 | + |
| 62 | + # list the environment for debugging purposes |
| 63 | + - name: mamba info |
| 64 | + run: | |
| 65 | + mamba info |
| 66 | + mamba list |
| 67 | +
|
| 68 | + # Clone RMG-database |
| 69 | + - name: Clone RMG-database |
| 70 | + run: | |
| 71 | + cd .. |
| 72 | + git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git |
| 73 | +
|
| 74 | + # modify env variables as directed in the RMG installation instructions |
| 75 | + - name: Set Environment Variables |
| 76 | + run: | |
| 77 | + RUNNER_CWD=$(pwd) |
| 78 | + echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV |
| 79 | + echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH |
| 80 | +
|
| 81 | + # RMG build step |
| 82 | + - name: make RMG |
| 83 | + run: | |
| 84 | + make clean |
| 85 | + make |
| 86 | +
|
| 87 | + - name: Install Q2DTor |
| 88 | + run: echo "" | make q2dtor |
| 89 | + |
| 90 | + # non-regression testing |
| 91 | + - name: Run Unit, Functional, and Database Tests |
| 92 | + # aggregate into one command so we only have to eat the collection time once |
| 93 | + run: make test-all |
0 commit comments