Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sidjha1 committed Nov 9, 2024
1 parent 9005636 commit 9664921
Showing 1 changed file with 25 additions and 37 deletions.
62 changes: 25 additions & 37 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,21 @@ on:

jobs:
setup-conda:
name: Setup Conda Environment
name: Setup Conda
runs-on: ubuntu-latest
outputs:
activate: echo "source \"$(conda info --base)/etc/profile.d/conda.sh\" && conda activate lotus"
conda_path: ${{ steps.conda-path.outputs.conda_path }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Miniconda
id: conda-path
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.10"
environment-file: environment.yml
activate-environment: lotus

- name: Cache Conda Environment
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}

ruff_lint:
name: Ruff Lint
Expand All @@ -43,13 +36,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Ruff
- name: Install Conda Environment
run: |
source "${{ needs.setup-conda.outputs.conda_path }}/etc/profile.d/conda.sh"
conda env create -f environment.yml
conda activate lotus
pip install -e .
pip install ruff==0.7.2
- name: Run Ruff
Expand All @@ -64,14 +56,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Activate Conda Environment
run: ${{ needs.setup-conda.outputs.activate }}
- name: Install Dependencies
- name: Install Conda Environment
run: |
python -m pip install --upgrade pip
pip install mypy==1.13.0
pip install -r requirements.txt
source "${{ needs.setup-conda.outputs.conda_path }}/etc/profile.d/conda.sh"
conda env create -f environment.yml
conda activate lotus
pip install -e .
pip install mypy==1.13.0
- name: Run Mypy
run: mypy lotus/
Expand All @@ -86,12 +77,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Activate Conda Environment
run: ${{ needs.setup-conda.outputs.activate }}
- name: Install Dependencies
- name: Install Conda Environment
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
source "${{ needs.setup-conda.outputs.conda_path }}/etc/profile.d/conda.sh"
conda env create -f environment.yml
conda activate lotus
pip install -e .
pip install pytest
Expand All @@ -114,12 +104,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Activate Conda Environment
run: ${{ needs.setup-conda.outputs.activate }}
- name: Install Dependencies
- name: Install Conda Environment
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
source "${{ needs.setup-conda.outputs.conda_path }}/etc/profile.d/conda.sh"
conda env create -f environment.yml
conda activate lotus
pip install -e .
pip install pytest
Expand Down Expand Up @@ -154,12 +143,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Activate Conda Environment
run: ${{ needs.setup-conda.outputs.activate }}
- name: Install Dependencies
- name: Install Conda Environment
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
source "${{ needs.setup-conda.outputs.conda_path }}/etc/profile.d/conda.sh"
conda env create -f environment.yml
conda activate lotus
pip install -e .
pip install pytest
Expand Down

0 comments on commit 9664921

Please sign in to comment.