require Python >= 3.8 #630
This file contains 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: ci | |
env: | |
CMAKE_BUILD_TYPE: Release | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
CTEST_NO_TESTS_ACTION: error | |
on: | |
push: | |
paths: | |
- "**.py" | |
- ".github/workflows/ci.yml" | |
- "src/gemini3d/libraries.json" | |
- "!scripts/**" | |
- "!example/**" | |
- "!Examples/**" | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 3 | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.9", "3.10", "3.11"] | |
include: | |
- os: macos-latest | |
python-version: "3.11" | |
- os: windows-latest | |
python-version: "3.11" | |
name: Lint ${{ matrix.os }} Python ${{ matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: python -m pip install -e .[lint] | |
timeout-minutes: 2 | |
- run: flake8 | |
- run: mypy | |
linux-macos: | |
strategy: | |
matrix: | |
python-version: ['3.11'] | |
os: [ubuntu-latest] | |
# include: | |
# - os: macos-latest | |
# python-version: '3.11' | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} Python ${{ matrix.python-version }} | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: setup environment variables | |
run: | | |
echo "CMAKE_PREFIX_PATH=${{ github.workspace }}/libgem" >> $GITHUB_ENV | |
echo "GEMINI_CIROOT=${{ github.workspace }}/data_gemci" >> $GITHUB_ENV | |
echo "GEMCI_ROOT=${{ github.workspace }}/gemci" >> $GITHUB_ENV | |
- name: Checkout Gemini3D-External | |
uses: actions/checkout@v3 | |
with: | |
repository: gemini3d/external | |
path: gemext | |
- name: Checkout GemGI (for simulation config.nml inputs) | |
uses: actions/checkout@v3 | |
with: | |
repository: gemini3d/gemci | |
path: ${{ env.GEMCI_ROOT }} | |
- name: Install Prereqs (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt update | |
sudo $(cmake -P gemext/scripts/requirements.cmake) | |
- name: Install Prereqs (Macos) | |
if: runner.os == 'macOS' | |
run: $(cmake -P gemext/scripts/requirements.cmake) | |
- name: set Fortran compiler (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
echo "FC=gfortran-12" >> $GITHUB_ENV | |
- name: Cache install Gemini3D-External | |
id: cache-gemext | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.CMAKE_PREFIX_PATH }} | |
key: ${{ runner.os }}-gemext-${{ hashFiles('gemext/cmake/libraries.json') }} | |
# weak check that gemini3d/external has changed since last cache update | |
- name: Non-Cache Install Gemini3D-External | |
if: steps.cache-gemext.outputs.cache-hit != 'true' | |
timeout-minutes: 15 | |
run: | | |
cmake -B build -Dfind:BOOL=true -Damr:BOOL=false --install-prefix ${{ env.CMAKE_PREFIX_PATH }} | |
cmake --build build --parallel | |
cmake --install build | |
working-directory: gemext | |
- name: Checkout Gemini3D | |
uses: actions/checkout@v3 | |
with: | |
repository: gemini3d/gemini3d | |
path: gemini3d | |
- name: Install Gemini3D | |
timeout-minutes: 15 | |
run: | | |
cmake -B build --install-prefix ${{ env.CMAKE_PREFIX_PATH }} | |
cmake --build build --parallel | |
cmake --install build | |
working-directory: gemini3d | |
- name: Git Checkout ${{ github.action_repository }} | |
uses: actions/checkout@v3 | |
- name: Install Python packages | |
run: python -m pip install .[tests,plots] | |
timeout-minutes: 5 | |
# transient CI download speed | |
- name: Unit and Integration Tests | |
run: pytest | |
timeout-minutes: 15 | |
# codecov coverage | |
# - run: pip install codecov pytest-cov | |
# - run: pytest --cov --cov-report=xml | |
# - name: Upload coverage to Codecov | |
# uses: codecov/codecov-action@v1 |