ubuntu-latest #17
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 | |
on: | |
push: | |
branches: | |
- master # Trigger the workflow on push to the master branch | |
pull_request: | |
branches: | |
- master # Trigger the workflow on pull requests to the master branch | |
jobs: | |
test: | |
timeout-minutes: 60 # Set a 60-minute timeout for the entire job | |
runs-on: ubuntu-latest # Use only Ubuntu | |
strategy: | |
matrix: | |
python-version: [3.8] # Test specifically with Python 3.8 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Set up Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" # Ensure Miniconda is installed | |
python-version: ${{ matrix.python-version }} | |
auto-update-conda: true | |
environment-file: environment.yml | |
activate-environment: tools21cm | |
- name: Initialize Conda | |
run: | | |
source ~/miniconda/etc/profile.d/conda.sh # Initialize Conda | |
conda init bash # Initialize Conda shell integration | |
shell: bash | |
- name: Update Python version in Conda environment | |
run: | | |
source ~/miniconda/etc/profile.d/conda.sh | |
conda activate tools21cm | |
conda install python=3.8 --update-deps # Specify exact Python version | |
shell: bash | |
- name: Install additional dependencies | |
run: | | |
source ~/miniconda/etc/profile.d/conda.sh | |
conda activate tools21cm | |
conda install -y pip | |
pip install . | |
shell: bash | |
- name: Run tests | |
run: | | |
source ~/miniconda/etc/profile.d/conda.sh | |
conda activate tools21cm | |
pytest | |
shell: bash |