From b28d4bee856da8922ce7a2d852b74e725bef4315 Mon Sep 17 00:00:00 2001 From: kumiori Date: Mon, 7 Oct 2024 12:51:03 +0200 Subject: [PATCH] test workflwos --- .github/workflows/conda.yml | 55 ++++++++++++++++++++++++++++++++++++ .github/workflows/ubuntu.yml | 49 ++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 .github/workflows/conda.yml create mode 100644 .github/workflows/ubuntu.yml diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml new file mode 100644 index 00000000..894c0419 --- /dev/null +++ b/.github/workflows/conda.yml @@ -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" \ No newline at end of file diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 00000000..32befa9a --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -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" \ No newline at end of file