Skip to content

Commit

Permalink
test on debian:11
Browse files Browse the repository at this point in the history
  • Loading branch information
RexWzh committed Dec 20, 2024
1 parent cd93388 commit 43d1ec3
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 62 deletions.
58 changes: 34 additions & 24 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python Package
name: Python Package with Conda from Miniconda Script

on:
push:
Expand All @@ -10,39 +10,49 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
container:
image: debian:11

strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]


steps:
- name: Update apt and install dependencies
run: |
apt-get update && apt-get install -y wget bash curl git build-essential python3-pip
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install Poetry
- name: Install Miniconda
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
echo "$HOME/miniconda/bin" >> $GITHUB_PATH
source $HOME/miniconda/etc/profile.d/conda.sh
conda init bash
conda config --set always_yes yes --set changeps1 no
- name: Create and Activate Conda Environment
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda create -n test-env python=${{ matrix.python-version }}
conda activate test-env
conda install pip
- name: Install Dependencies with Poetry
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate test-env
pip install poetry
poetry build
poetry install
- name: Test with pytest
- name: Run Tests
run: |
poetry run pytest -s tests/
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate test-env
poetry run pytest -s tests/
File renamed without changes.
74 changes: 37 additions & 37 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ python = "^3.10"

[tool.poetry.build]
generate-setup-file = false
script = "custom_build.py"
script = "build.py"

[tool.poetry.group.dev.dependencies]
# Experiment related dependencies here to not clutter the main project dependencies.
Expand Down

0 comments on commit 43d1ec3

Please sign in to comment.