From 379d3f95c78f86e78b055d29d63c7f94b18471ee Mon Sep 17 00:00:00 2001 From: John Truckenbrodt Date: Wed, 3 Jul 2024 17:57:10 +0200 Subject: [PATCH] fix GitHub Actions conda build (#50) --- .github/workflows/python-package-conda.yml | 44 +++++++--------------- environment-doc.yml | 2 +- environment.yml | 2 +- requirements.txt | 2 +- 4 files changed, 17 insertions(+), 33 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index ef12749..331fc15 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -1,39 +1,19 @@ name: conda build -on: [ push ] +on: [ "push" ] jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - ubuntu-latest - - windows-latest - - macos-latest + linux: + runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: conda-incubator/setup-miniconda@v3 with: + miniconda-version: "latest" python-version: '3.10' - - name: Set paths and variables windows - if: startsWith(matrix.os, 'windows') - run: | - echo "$env:CONDA\condabin" | Out-File -FilePath $env:GITHUB_PATH -Append - echo "$env:CONDA\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Append - echo "$env:CONDA\Library\bin" | Out-File -FilePath $env:GITHUB_PATH -Append - echo "PROJ_DATA=$env:CONDA\Library\share\proj" | Out-File -FilePath $env:GITHUB_ENV -Append - - name: Set paths and variables - if: ${{ ! startsWith(matrix.os, 'windows') }} - run: | - echo "$CONDA/bin" >> $GITHUB_PATH - echo "PROJ_DATA=$CONDA/share/proj" >> $GITHUB_ENV - - name: Install dependencies - run: | - conda env update --file environment.yml --name base + environment-file: environment.yml - name: Lint with flake8 - if: startsWith(matrix.os, 'ubuntu') + shell: bash -el {0} run: | conda install flake8 # stop the build if there are Python syntax errors or undefined names @@ -41,13 +21,17 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Install package + shell: bash -el {0} run: | pip install . - name: Test with pytest + shell: bash -el {0} run: | conda install pytest coverage coverage run -m pytest + coverage xml - name: Publish to coveralls.io - uses: coverallsapp/github-action@v2 + uses: coverallsapp/github-action@v2.3.0 with: - github-token: ${{ github.token }} + path-to-lcov: coverage.xml + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/environment-doc.yml b/environment-doc.yml index baf5d7d..e6729f0 100644 --- a/environment-doc.yml +++ b/environment-doc.yml @@ -6,7 +6,7 @@ dependencies: - python>=3.8 - progressbar2 - pathos>=0.2 - - numpy + - numpy<2.0 - matplotlib-base - tblib - pyyaml diff --git a/environment.yml b/environment.yml index f10264a..776a5cf 100644 --- a/environment.yml +++ b/environment.yml @@ -6,7 +6,7 @@ dependencies: - python>=3.8 - progressbar2 - pathos>=0.2 - - numpy + - numpy<2.0 - matplotlib-base - tblib - pyyaml diff --git a/requirements.txt b/requirements.txt index b8a5807..d2dc049 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ progressbar2 pathos>=0.2 -numpy +numpy<2.0 tblib pyyaml dill