New ESACCI AEROSOL CMORizer (Python version) (#3629) #2902
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: Test | |
| # runs on a push on main and at the end of every day | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "0 0 * * *" | |
| # Required shell entrypoint to have properly configured bash shell | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| linux: | |
| runs-on: "ubuntu-latest" | |
| if: github.repository == 'ESMValGroup/ESMValTool' # avoid GAs in forks | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.12", "3.13"] | |
| name: Linux Python ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| activate-environment: esmvaltool | |
| environment-file: environment.yml | |
| python-version: ${{ matrix.python-version }} | |
| miniforge-version: "latest" | |
| use-mamba: true | |
| - run: mkdir -p test_linux_artifacts_python_${{ matrix.python-version }} | |
| - name: Record versions | |
| run: | | |
| mamba --version 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt | |
| python -V 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt | |
| # this is how to export variables to the GITHUB var environment | |
| echo "pver0=$(python -V)" >> $GITHUB_ENV | |
| - name: Inspect environment | |
| run: conda list | |
| - name: Install ESMValTool | |
| run: pip install --no-deps -e .[develop] 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/install.txt | |
| - name: Inspect environment | |
| run: conda list | |
| - name: Check dependencies are compatible | |
| run: pip check | |
| - name: Check NCL | |
| run: ncl -V | |
| - name: Check code quality | |
| run: pre-commit run -a | |
| - name: Run tests | |
| run: pytest -n 2 -m "not installation" 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/test_report.txt | |
| - name: Upload artifacts | |
| if: ${{ always() }} # upload artifacts even if fail | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Test_Linux_python_${{ matrix.python-version }} | |
| path: test_linux_artifacts_python_${{ matrix.python-version }} | |
| osx: | |
| runs-on: "macos-latest" | |
| if: github.repository == 'ESMValGroup/ESMValTool' # avoid GAs in forks | |
| strategy: | |
| matrix: | |
| python-version: ["3.12", "3.13"] | |
| fail-fast: false | |
| name: OSX Python ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| architecture: ${{ matrix.architecture }} | |
| activate-environment: esmvaltool | |
| environment-file: environment_osx.yml | |
| python-version: ${{ matrix.python-version }} | |
| miniforge-version: "latest" | |
| use-mamba: true | |
| # - name: Install libomp with homebrew | |
| # run: brew install libomp | |
| - run: mkdir -p test_osx_artifacts_python_${{ matrix.python-version }} | |
| - name: Record versions | |
| run: | | |
| mamba --version 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/conda_version.txt | |
| python -V 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/python_version.txt | |
| - name: Inspect environment | |
| run: conda list | |
| - name: Determine if git | |
| run: | | |
| which git | |
| git --version | |
| - name: Install ESMValTool | |
| run: pip install --no-deps -e .[develop] 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/install.txt | |
| - name: Inspect environment | |
| run: conda list | |
| - name: Check dependencies are compatible | |
| run: pip check | |
| - name: Check code quality | |
| run: pre-commit run -a | |
| - name: Run tests | |
| run: pytest -n 2 -m "not installation" 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/test_report.txt | |
| - name: Upload artifacts | |
| if: ${{ always() }} # upload artifacts even if fail | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Test_OSX_python_${{ matrix.python-version }} | |
| path: test_osx_artifacts_python_${{ matrix.python-version }} |