Skip to content

Commit

Permalink
test workflwos
Browse files Browse the repository at this point in the history
  • Loading branch information
kumiori committed Oct 7, 2024
1 parent 0398eec commit b28d4be
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Test Conda Installation

# This triggers the workflow on any push to the repository
on:
push:
branches:
- "**"
pull_request:

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"
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: |
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: |
echo "Running tests"
conda activate fenicsx-env
cd test && pytest -v . || echo "Tests failed"
49 changes: 49 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test Ubuntu Installation

# This triggers the workflow on any push to the repository
on:
push:
branches:
- "**"
pull_request:

jobs:
test:
name: Test Ubuntu/apt 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

# Install Ubuntu dependencies via APT
- name: Install system dependencies via APT
run: |
echo "Installing required system dependencies via APT"
sudo apt-get update
sudo apt-get install -y software-properties-common python3-pip git libgl1-mesa-glx xvfb libglu1 libxcursor1 libxinerama1
# Add the FEniCS PPA and install fenicsx
- name: Install fenicsx
run: |
echo "Adding FEniCS PPA and installing fenicsx"
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt update
sudo apt-get install -y fenicsx
# Install irrevolutions dependencies (if any) and the package itself
- name: Install Python dependencies and irrevolutions
run: |
echo "Installing Python dependencies and irrevolutions"
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt # Adjust this if you're using a different file for dependencies
python3 -m pip install . # Install irrevolutions package
# Optionally run tests within the environment
- name: Run tests
run: |
echo "Running tests"
conda activate fenicsx-env
cd test && pytest -v . || echo "Tests failed"

0 comments on commit b28d4be

Please sign in to comment.