1+ name : Tests
2+ on :
3+ push :
4+ branches : main
5+ pull_request :
6+ branches : main
7+
8+ jobs :
9+ unit-testing :
10+ defaults :
11+ run :
12+ # Set default shell to login-bash
13+ # This is required to properly activate the conda environment
14+ # https://github.com/conda-incubator/setup-miniconda?tab=readme-ov-file#use-a-default-shell
15+ shell : bash -el {0}
16+
17+ runs-on : ${{ matrix.os }}
18+ strategy :
19+ matrix :
20+ os : [ubuntu-latest, macos-latest, windows-latest]
21+
22+ steps :
23+ - name : Install xmllint on Linux
24+ if : runner.os == 'Linux'
25+ run : sudo apt-get install libxml2-utils
26+
27+ - name : Get Safe PYTHON_VERSION
28+ run : echo "PYTHON_VERSION=$(curl --location https://devguide.python.org/versions | xmllint --html --xpath '//section[@id="supported-versions"]//table/tbody/tr[count(//section[@id="supported-versions"]//table/tbody/tr[td[.="security"]]/preceding-sibling::*)]/td[1]/p/text()' - 2> /dev/null)" >> $GITHUB_ENV
29+
30+ - name : Checkout Repository
31+ uses : actions/checkout@v4
32+
33+ - name : Update environment.yml with PYTHON_VERSION
34+ run : sed -r 's/- python[>=]+[0-9]+\.[0-9]+/- python==${{ env.PYTHON_VERSION }}/' environment.yml > environment_new.yml
35+
36+ - name : Display environment_new.yml
37+ run : cat environment_new.yml
38+
39+ - name : Set up Miniconda and Install New Dependencies
40+ uses : conda-incubator/setup-miniconda@v3
41+ with :
42+ environment-file : environment_new.yml
43+
44+ - name : Remove environment_new.yml
45+ run : rm -rf environment_new.yml
46+
47+ - name : Display Conda Environments
48+ run : conda env list
49+
50+ - name : Display All Installed Packages
51+ run : conda list
52+
53+ - name : Display Python Version
54+ run : python -c "import sys; print(sys.version)"
55+
56+ - name : Show Full Numba Environment
57+ run : python -m numba -s
58+
59+ - name : Run Unit Tests and Coverage
60+ run : ./test.sh
0 commit comments