-
-
Notifications
You must be signed in to change notification settings - Fork 5
60 lines (52 loc) · 2.1 KB
/
conda.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Test Conda Installation
# This triggers the workflow on any push to the repository
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
jobs:
test:
name: Test Conda Installation and Setup
runs-on: ubuntu-latest
# Steps to run
steps:
# Checkout the repo content to the runner
- name: Checkout repository
uses: actions/checkout@v2
# Set up Miniconda
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
channels: conda-forge, defaults
auto-update-conda: true
auto-activate-base: true
# Create the environment and install dependencies
- name: Create and activate conda environment
run: |
echo "Creating the conda environment: fenicsx-env"
conda create -n fenicsx-env -c conda-forge fenics-dolfinx=0.7.2 mpich pyvista sympy pandas pyyaml -y
echo "Activating the conda environment"
source $(conda info --base)/etc/profile.d/conda.sh # Fix to allow `conda activate`
conda activate fenicsx-env
echo "Environment created and activated. Now, verifying installation..."
conda list # Print all installed packages for verification
which python # Verify the Python interpreter being used
# Install the irrevolutions package in the conda environment
- name: Install irrevolutions
run: |
source $(conda info --base)/etc/profile.d/conda.sh # Ensure conda is properly initialized
echo "Installing irrevolutions package"
conda activate fenicsx-env
python -m pip install . # Assuming irrevolutions is in the current directory
echo "irrevolutions package installed"
# Optionally run tests within the environment
- name: Run tests
run: |
source $(conda info --base)/etc/profile.d/conda.sh # Ensure conda is properly initialized
echo "Running tests"
conda activate fenicsx-env
cd test && python3 -m pytest . || echo "Tests failed"