Skip to content

Commit 24f140f

Browse files
committed
split the python-only test into separate CI to simplify reg test logic
1 parent b774dec commit 24f140f

File tree

2 files changed

+94
-6
lines changed

2 files changed

+94
-6
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ jobs:
5757
matrix:
5858
python-version: ["3.9"]
5959
os: [macos-13, macos-latest, ubuntu-latest]
60-
test_julia: [yes, no]
6160
runs-on: ${{ matrix.os }}
62-
name: ${{ matrix.os }} Build and Test Python ${{ matrix.python-version }} (Julia? ${{ matrix.test_julia }})
61+
name: ${{ matrix.os }} Build and Test Python ${{ matrix.python-version }}
6362
# skip scheduled runs from forks
6463
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
6564
env:
@@ -115,7 +114,6 @@ jobs:
115114
116115
# Setup Juliaup
117116
- name: Set Julia paths
118-
if: matrix.test_julia == 'yes'
119117
run: |
120118
# echo "JULIAUP_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_ENV
121119
# echo "JULIAUP_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_PATH
@@ -129,18 +127,15 @@ jobs:
129127
# echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_PATH
130128
131129
- name: Setup Juliaup
132-
if: matrix.test_julia == 'yes'
133130
uses: julia-actions/install-juliaup@v2
134131
with:
135132
channel: '1.9'
136133

137134
- name: Check Julia version
138-
if: matrix.test_julia == 'yes'
139135
run: julia --version
140136

141137
# RMS installation and linking to Julia
142138
- name: Install and link Julia dependencies
143-
if: matrix.test_julia == 'yes'
144139
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
145140
# JULIA_CONDAPKG_EXE points to the existing conda/mamba to avoid JuliaCall from installing their own. See https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-a-Conda-environment.
146141
run: |
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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

Comments
 (0)