Revision 6948d5512d3a9b5b7db1367128f0b9c6ddc690f1 authored by FranziskaWinterstein on 13 April 2023, 12:13:27 UTC, committed by GitHub on 13 April 2023, 12:13:27 UTC
1 parent 2b88c72
Raw File
test-development.yml
# Action that runs the full development stack:
# Steps (Python-only):
# - creates esmvaltool conda environment and pip-installs esmvaltool
# - downloads latest main of esmvalcore and installs it in development mode
# - runs tests of esmvaltool
# Triggered by a push to main and nightly
---
name: Test in Full Development Mode

# runs on a push on main and at the end of every day
on:
  push:
    branches:
      - main
  schedule:
    - cron: '0 0 * * *'

jobs:
  linux:
    runs-on: "ubuntu-latest"
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.8", "3.9", "3.10"]
    name: Linux Python ${{ matrix.python-version }}
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: conda-incubator/setup-miniconda@v2
        with:
          activate-environment: esmvaltool
          environment-file: environment.yml
          python-version: ${{ matrix.python-version }}
          miniforge-version: "latest"
          miniforge-variant: Mambaforge
          use-mamba: true
      - shell: bash -l {0}
        run: mkdir -p develop_test_linux_artifacts_python_${{ matrix.python-version }}
      - name: Record versions
        shell: bash -l {0}
        run: |
          mamba --version 2>&1 | tee develop_test_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
          python -V 2>&1 | tee develop_test_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
      - name: Install ESMValTool
        shell: bash -l {0}
        run: pip install -e .[develop] 2>&1 | tee develop_test_linux_artifacts_python_${{ matrix.python-version }}/install.txt
      - name: Install Julia dependencies
        shell: bash -l {0}
        run: esmvaltool install Julia
      - name: Install development version of ESMValCore
        shell: bash -l {0}
        run: |
          cd ..
          git clone https://github.com/ESMValGroup/ESMValCore.git
          cd ESMValCore
          pip install -e .[develop]
      - name: Run flake8
        shell: bash -l {0}
        run: flake8
      - name: Run tests
        shell: bash -l {0}
        run: pytest -n 2 -m "not installation" 2>&1 | tee develop_test_linux_artifacts_python_${{ matrix.python-version }}/test_report.txt
      - name: Upload artifacts
        if: ${{ always() }}  # upload artifacts even if fail
        uses: actions/upload-artifact@v2
        with:
          name: Develop_Test_Linux_python_${{ matrix.python-version }}
          path: develop_test_linux_artifacts_python_${{ matrix.python-version }}
back to top