From 04be0261609eacb4e3089eef8d8af5586c394a0a Mon Sep 17 00:00:00 2001 From: Mehdi Seifi Date: Fri, 8 Nov 2024 20:15:02 +0100 Subject: [PATCH] updated workflow to use conda --- .github/workflows/test_deploy_conda.yml | 62 ++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_deploy_conda.yml b/.github/workflows/test_deploy_conda.yml index 43766f0..5d09891 100644 --- a/.github/workflows/test_deploy_conda.yml +++ b/.github/workflows/test_deploy_conda.yml @@ -12,7 +12,7 @@ on: jobs: setup: - name: Setup + name: Setup and Test runs-on: ${{ matrix.platform }} defaults: @@ -27,6 +27,8 @@ jobs: steps: - uses: actions/checkout@v4 + # these libraries enable testing on Qt on linux + - uses: tlambert03/setup-qt-libs@v1 - uses: conda-incubator/setup-miniconda@v3.1.0 with: auto-update-conda: true @@ -44,7 +46,63 @@ jobs: - name: Setup run: conda env create --name ff --file env_cpu.yml + # strategy borrowed from vispy for installing opengl libs on windows + - name: Install Windows OpenGL + if: runner.os == "Windows" + run: | + conda activate ff + git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git + powershell gl-ci-helpers/appveyor/install_opengl.ps1 + - name: Run Tests + uses: aganders3/headless-gui@v1 run: | conda activate ff - conda list + python -m pip install .[dev] + pytest -v --color=yes --cov=featureforest --cov-report=xml -m "not slow" + + - name: Coverage + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} # required + version: v0.7.3 + verbose: true # optional (default = false) + + publish: + # this will run when you have tagged a commit, starting with "v*" + # and requires that you have put your twine API key in your + # github secrets (see readme for details) + needs: [setup] + runs-on: ubuntu-latest + + if: contains(github.ref, "tags") + + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + + # This permission allows writing releases + contents: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Build + run: | + python -m pip install build + python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + - uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true +