Created
November 19, 2023 22:44
-
-
Save guidorice/5e96cd8db290ceaf804642d7cbaceea5 to your computer and use it in GitHub Desktop.
github action for mojo + conda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Tests | |
| on: | |
| pull_request: | |
| types: [opened, reopened] | |
| push: | |
| branches: | |
| - 'main' | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| - name: "Setup conda env (base)" | |
| uses: conda-incubator/setup-miniconda@v2 | |
| with: | |
| python-version: 3.11 | |
| auto-activate-base: true | |
| - name: "Install mojo" | |
| run: | | |
| curl https://get.modular.com | MODULAR_AUTH=${{ secrets.MODULAR_AUTH }} sh - | |
| modular auth ${{ secrets.MODULAR_AUTH }} | |
| modular install mojo | |
| - name: "Setup conda env (geo-features)" | |
| uses: conda-incubator/setup-miniconda@v2 | |
| with: | |
| python-version: 3.11 | |
| activate-environment: geo-features | |
| environment-file: environment.yml | |
| - name: "Run mojo-pytest" | |
| run: | | |
| export MODULAR_HOME="/home/runner/.modular" | |
| export PATH="/home/runner/.modular/pkg/packages.modular.com_mojo/bin:$PATH" | |
| export MOJO_PYTHON_LIBRARY="$(find $CONDA_PREFIX/lib -iname 'libpython*.[s,d]*' | sort -r | head -n 1)" | |
| pytest -W error | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
export MOJO_PYTHON_LIBRARY="$(find $CONDA_PREFIX/lib -iname 'libpython*.[s,d]*' | sort -r | head -n 1)"this could be simplified because we know the CI runner is linux-ubuntu.