Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Github Actions] Compress all bash shell setters into one default option per workflow #2126

Merged
merged 9 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions .github/workflows/create-condalock-file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
schedule:
- cron: '0 4 */10 * *'

# Required shell entrypoint to have properly configured bash shell
defaults:
run:
shell: bash -l {0}

jobs:
create-verify-lock-file:
name: Create and verify conda lock file for latest Python
Expand All @@ -27,53 +32,43 @@ jobs:
miniforge-variant: Mambaforge
use-mamba: true
- name: Show conda config
shell: bash -l {0}
run: |
conda update -n base -c conda-forge conda
conda info
conda list
conda config --show-sources
conda config --show
- name: Gather Python info
shell: bash -l {0}
run: |
which python
python --version
- name: Install conda-lock
shell: bash -l {0}
run: mamba install -y conda-lock
- name: Check version of conda-lock
shell: bash -l {0}
run: conda-lock --version
- name: Create conda lock file for linux-64
shell: bash -l {0}
run: conda-lock lock --platform linux-64 -f environment.yml --mamba --kind explicit
- name: Creating environment from lock file
shell: bash -l {0}
run: conda create --name esmvaltool-fromlock --file conda-linux-64.lock
- name: Installing pip
shell: bash -l {0}
run: mamba install -y pip
- name: Gather pip info
shell: bash -l {0}
run: pip --version
- name: Gather Python info again
shell: bash -l {0}
run: |
which python
python --version
- name: Show environment contents
shell: bash -l {0}
run: conda list
- shell: bash -l {0}
- name: Install esmvalcore
run: pip install -e .[develop]
- shell: bash -l {0}
run: esmvaltool --help
- shell: bash -l {0}
run: esmvaltool version
- shell: bash -l {0}
- name: Run basic commands
run: |
esmvaltool --help
esmvaltool version
- name: Run flake8
run: flake8
- shell: bash -l {0}
- name: Run pytests
run: pytest -n 2 -m "not installation"
# Automated PR
# see https://github.com/marketplace/actions/create-pull-request
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/install-from-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ on:
schedule:
- cron: '0 4 * * *'

# Required shell entrypoint to have properly configured bash shell
defaults:
run:
shell: bash -l {0}

jobs:
linux:
runs-on: "ubuntu-latest"
Expand All @@ -46,20 +51,16 @@ jobs:
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- shell: bash -l {0}
run: mkdir -p conda_install_linux_artifacts_python_${{ matrix.python-version }}
- run: mkdir -p conda_install_linux_artifacts_python_${{ matrix.python-version }}
- name: Record versions
shell: bash -l {0}
run: |
mamba --version 2>&1 | tee conda_install_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
which conda 2>&1 | tee conda_install_linux_artifacts_python_${{ matrix.python-version }}/conda_path.txt
which mamba 2>&1 | tee -a conda_install_linux_artifacts_python_${{ matrix.python-version }}/conda_path.txt
python -V 2>&1 | tee conda_install_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
- name: Install ESMValCore
shell: bash -l {0}
run: mamba install esmvalcore 2>&1 | tee conda_install_linux_artifacts_python_${{ matrix.python-version }}/install.txt
- name: Verify installation
shell: bash -l {0}
run: |
esmvaltool --help
esmvaltool version 2>&1 | tee conda_install_linux_artifacts_python_${{ matrix.python-version }}/version.txt
Expand All @@ -84,20 +85,16 @@ jobs:
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- shell: bash -l {0}
run: mkdir -p conda_install_osx_artifacts_python_${{ matrix.python-version }}
- run: mkdir -p conda_install_osx_artifacts_python_${{ matrix.python-version }}
- name: Record versions
shell: bash -l {0}
run: |
mamba --version 2>&1 | tee conda_install_osx_artifacts_python_${{ matrix.python-version }}/conda_version.txt
which conda 2>&1 | tee conda_install_osx_artifacts_python_${{ matrix.python-version }}/conda_path.txt
which mamba 2>&1 | tee -a conda_install_osx_artifacts_python_${{ matrix.python-version }}/conda_path.txt
python -V 2>&1 | tee conda_install_osx_artifacts_python_${{ matrix.python-version }}/python_version.txt
- name: Install ESMValCore
shell: bash -l {0}
run: mamba install esmvalcore 2>&1 | tee conda_install_osx_artifacts_python_${{ matrix.python-version }}/install.txt
- name: Verify installation
shell: bash -l {0}
run: |
esmvaltool --help
esmvaltool version 2>&1 | tee conda_install_osx_artifacts_python_${{ matrix.python-version }}/version.txt
Expand Down
44 changes: 18 additions & 26 deletions .github/workflows/install-from-condalock-file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ on:
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"
Expand All @@ -36,32 +41,19 @@ jobs:
activate-environment: esmvaltool-fromlock
python-version: ${{ matrix.python-version }}
channels: conda-forge
- shell: bash -l {0}
run: mkdir -p source_install_linux_artifacts_python_${{ matrix.python-version }}
- shell: bash -l {0}
run: conda --version 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- shell: bash -l {0}
run: which python
- shell: bash -l {0}
run: python -V 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
- shell: bash -l {0}
run: conda create --name esmvaltool-fromlock --file conda-linux-64.lock
- shell: bash -l {0}
run: conda install pip
- shell: bash -l {0}
run: which python
- shell: bash -l {0}
run: pip --version
- shell: bash -l {0}
run: pip install -e .[develop]
- shell: bash -l {0}
run: esmvaltool --help
- shell: bash -l {0}
run: esmvaltool version 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/version.txt
- shell: bash -l {0}
run: flake8
- shell: bash -l {0}
run: pytest -n 2 -m "not installation"
- run: mkdir -p source_install_linux_artifacts_python_${{ matrix.python-version }}
- run: conda --version 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- run: which python
- run: python -V 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
- run: conda create --name esmvaltool-fromlock --file conda-linux-64.lock
- run: conda install pip
- run: which python
- run: pip --version
- run: pip install -e .[develop]
- run: esmvaltool --help
- run: esmvaltool version 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/version.txt
- run: flake8
- run: pytest -n 2 -m "not installation"
- name: Upload artifacts
if: ${{ always() }} # upload artifacts even if fail
uses: actions/upload-artifact@v2
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/install-from-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ on:
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"
Expand All @@ -49,19 +54,15 @@ jobs:
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- shell: bash -l {0}
run: mkdir -p pip_install_linux_artifacts_python_${{ matrix.python-version }}
- run: mkdir -p pip_install_linux_artifacts_python_${{ matrix.python-version }}
- name: Record versions
shell: bash -l {0}
run: |
mamba --version 2>&1 | tee pip_install_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
python -V 2>&1 | tee pip_install_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
pip -V 2>&1 | tee pip_install_linux_artifacts_python_${{ matrix.python-version }}/pip_version.txt
- name: Install
shell: bash -l {0}
run: pip install esmvalcore 2>&1 | tee pip_install_linux_artifacts_python_${{ matrix.python-version }}/install.txt
- name: Verify installation
shell: bash -l {0}
run: |
esmvaltool --help
esmvaltool version 2>&1 | tee pip_install_linux_artifacts_python_${{ matrix.python-version }}/version.txt
Expand Down Expand Up @@ -89,19 +90,15 @@ jobs:
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- shell: bash -l {0}
run: mkdir -p pip_install_osx_artifacts_python_${{ matrix.python-version }}
- run: mkdir -p pip_install_osx_artifacts_python_${{ matrix.python-version }}
- name: Record versions
shell: bash -l {0}
run: |
mamba --version 2>&1 | tee pip_install_osx_artifacts_python_${{ matrix.python-version }}/conda_version.txt
python -V 2>&1 | tee pip_install_osx_artifacts_python_${{ matrix.python-version }}/python_version.txt
pip -V 2>&1 | tee pip_install_osx_artifacts_python_${{ matrix.python-version }}/pip_version.txt
- name: Install
shell: bash -l {0}
run: pip install esmvalcore 2>&1 | tee pip_install_osx_artifacts_python_${{ matrix.python-version }}/install.txt
- name: Verify installation
shell: bash -l {0}
run: |
esmvaltool --help
esmvaltool version 2>&1 | tee pip_install_osx_artifacts_python_${{ matrix.python-version }}/version.txt
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/install-from-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ on:
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"
Expand All @@ -47,18 +52,14 @@ jobs:
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- shell: bash -l {0}
run: mkdir -p source_install_linux_artifacts_python_${{ matrix.python-version }}
- run: mkdir -p source_install_linux_artifacts_python_${{ matrix.python-version }}
- name: Record versions
shell: bash -l {0}
run: |
mamba --version 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
python -V 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
- name: Install
shell: bash -l {0}
run: pip install -e .[develop] 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/install.txt
- name: Verify installation
shell: bash -l {0}
run: |
esmvaltool --help
esmvaltool version 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/version.txt
Expand Down Expand Up @@ -88,18 +89,14 @@ jobs:
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- shell: bash -l {0}
run: mkdir -p source_install_osx_artifacts_python_${{ matrix.python-version }}
- run: mkdir -p source_install_osx_artifacts_python_${{ matrix.python-version }}
- name: Record versions
shell: bash -l {0}
run: |
mamba --version 2>&1 | tee source_install_osx_artifacts_python_${{ matrix.python-version }}/conda_version.txt
python -V 2>&1 | tee source_install_osx_artifacts_python_${{ matrix.python-version }}/python_version.txt
- name: Install
shell: bash -l {0}
run: pip install -e .[develop] 2>&1 | tee source_install_osx_artifacts_python_${{ matrix.python-version }}/install.txt
- name: Verify installation
shell: bash -l {0}
run: |
esmvaltool --help
esmvaltool version 2>&1 | tee source_install_osx_artifacts_python_${{ matrix.python-version }}/version.txt
Expand Down
45 changes: 19 additions & 26 deletions .github/workflows/run-tests-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ on:
types:
- created

# Required shell entrypoint to have properly configured bash shell
defaults:
run:
shell: bash -l {0}

jobs:
linux:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false
name: Linux Python ${{ matrix.python-version }}
if: ${{ github.event.issue.pull_request && github.event.comment.body == '@runGAtests' }}
Expand All @@ -25,18 +30,12 @@ jobs:
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- shell: bash -l {0}
run: mkdir -p test_linux_artifacts_python_${{ matrix.python-version }}
- shell: bash -l {0}
run: conda --version 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- shell: bash -l {0}
run: python -V 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
- shell: bash -l {0}
run: pip install -e .[develop] 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/install.txt
- shell: bash -l {0}
run: flake8
- shell: bash -l {0}
run: pytest -n 2 -m "not installation" 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/test_report.txt
- run: mkdir -p test_linux_artifacts_python_${{ matrix.python-version }}
- run: conda --version 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- run: python -V 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
- run: pip install -e .[develop] 2>&1 | tee test_linux_artifacts_python_${{ matrix.python-version }}/install.txt
- run: flake8
- 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@v2
Expand All @@ -48,7 +47,7 @@ jobs:
runs-on: "macos-latest"
strategy:
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
if: ${{ github.event.issue.pull_request && github.event.comment.body == '@runGAtests' }}
Expand All @@ -64,18 +63,12 @@ jobs:
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- shell: bash -l {0}
run: mkdir -p test_osx_artifacts_python_${{ matrix.python-version }}
- shell: bash -l {0}
run: conda --version 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- shell: bash -l {0}
run: python -V 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/python_version.txt
- shell: bash -l {0}
run: pip install -e .[develop] 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/install.txt
- shell: bash -l {0}
run: flake8
- shell: bash -l {0}
run: pytest -n 2 -m "not installation" 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/test_report.txt
- run: mkdir -p test_osx_artifacts_python_${{ matrix.python-version }}
- run: conda --version 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- run: python -V 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/python_version.txt
- run: pip install -e .[develop] 2>&1 | tee test_osx_artifacts_python_${{ matrix.python-version }}/install.txt
- run: flake8
- 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@v2
Expand Down
Loading