From 8d6f2b54178940e745f4219a199d21a9d4ade561 Mon Sep 17 00:00:00 2001 From: "Jason K. Moore" Date: Wed, 28 Jul 2021 16:57:41 +0200 Subject: [PATCH 1/5] Adds configuration to use github actions for testing. --- .github/workflows/run-tests.yml | 55 +++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/run-tests.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 00000000..c11da07a --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,55 @@ +name: cyipopt testing + +on: + push: + branches: source + pull_request: + branches: source + +jobs: + build: + + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + ipopt-version: [3.12, 3.13] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install conda + run: | + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; + chmod +x miniconda.sh + ./miniconda.sh -b -p $HOME/miniconda + source "$HOME/miniconda/etc/profile.d/conda.sh" + conda init bash + conda config --set always_yes yes --set changeps1 no + conda config --add channels conda-forge + conda update -q conda + - name: Create conda environment + run: | + conda create -q -n test-env python=${{ matrix.python-version }} + conda activate test-env + conda install -y -q lapack "libblas=*=*netlib" cython>=0.26 "ipopt=${{ matrix.ipopt-version }}" numpy>=1.15 pkg-config>=0.29.2 setuptools>=39.0 + conda info -a + conda list + - name: Run tests + run: | + conda activate test-env + python setup.py install + python -c "import cyipopt" + conda install -y -q pytest>=3.3.2 + pytest + conda install -y -q scipy>=0.19.1 + pytest + - name: Build documentation + run: | + conda activate test-env + conda install -y -q --file docs/requirements.txt + cd docs && make clean && make html && cd .. From a060a097300e99825cf9cdab31e04400c85c7e79 Mon Sep 17 00:00:00 2001 From: "Jason K. Moore" Date: Wed, 28 Jul 2021 17:02:26 +0200 Subject: [PATCH 2/5] Fix branch name. --- .github/workflows/run-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index c11da07a..eef9e72b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -2,9 +2,9 @@ name: cyipopt testing on: push: - branches: source + branches: master pull_request: - branches: source + branches: master jobs: build: From 12130376d8dba676228dd6ae2b7a5ad8581e6ca7 Mon Sep 17 00:00:00 2001 From: "Jason K. Moore" Date: Wed, 28 Jul 2021 17:38:57 +0200 Subject: [PATCH 3/5] Add conda init bash to each section. --- .github/workflows/run-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index eef9e72b..7c4ed2ee 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -34,6 +34,7 @@ jobs: conda update -q conda - name: Create conda environment run: | + conda init bash conda create -q -n test-env python=${{ matrix.python-version }} conda activate test-env conda install -y -q lapack "libblas=*=*netlib" cython>=0.26 "ipopt=${{ matrix.ipopt-version }}" numpy>=1.15 pkg-config>=0.29.2 setuptools>=39.0 @@ -41,6 +42,7 @@ jobs: conda list - name: Run tests run: | + conda init bash conda activate test-env python setup.py install python -c "import cyipopt" @@ -50,6 +52,7 @@ jobs: pytest - name: Build documentation run: | + conda init bash conda activate test-env conda install -y -q --file docs/requirements.txt cd docs && make clean && make html && cd .. From 892e98ee5573c8b38aefd18bd2b70a4458d32c09 Mon Sep 17 00:00:00 2001 From: "Jason K. Moore" Date: Wed, 28 Jul 2021 17:41:39 +0200 Subject: [PATCH 4/5] Try all in one section. --- .github/workflows/run-tests.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7c4ed2ee..a429edb2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -32,27 +32,16 @@ jobs: conda config --set always_yes yes --set changeps1 no conda config --add channels conda-forge conda update -q conda - - name: Create conda environment - run: | - conda init bash conda create -q -n test-env python=${{ matrix.python-version }} conda activate test-env conda install -y -q lapack "libblas=*=*netlib" cython>=0.26 "ipopt=${{ matrix.ipopt-version }}" numpy>=1.15 pkg-config>=0.29.2 setuptools>=39.0 conda info -a conda list - - name: Run tests - run: | - conda init bash - conda activate test-env python setup.py install python -c "import cyipopt" conda install -y -q pytest>=3.3.2 pytest conda install -y -q scipy>=0.19.1 pytest - - name: Build documentation - run: | - conda init bash - conda activate test-env conda install -y -q --file docs/requirements.txt cd docs && make clean && make html && cd .. From 072c9e29a1ed860d2b6af65b6aee11ccbe9fc75a Mon Sep 17 00:00:00 2001 From: "Jason K. Moore" Date: Wed, 28 Jul 2021 17:44:58 +0200 Subject: [PATCH 5/5] Fixed section name. --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a429edb2..153cae5a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -22,7 +22,7 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - name: Install conda + - name: Install conda, test, & build docs run: | wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; chmod +x miniconda.sh