Skip to content

Commit

Permalink
Fix environment-name behaviour (#50, #54) and add Docker support (#46
Browse files Browse the repository at this point in the history
…) (#55)
  • Loading branch information
jonashaag authored May 14, 2022
1 parent d7eeccc commit de032af
Show file tree
Hide file tree
Showing 8 changed files with 517 additions and 374 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/resources/environment_without_name.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
channels:
- conda-forge
dependencies:
- xtensor
64 changes: 64 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: install binary only
uses: ./
with:
environment-file: false

- name: install mamba
uses: ./

Expand Down Expand Up @@ -66,3 +71,62 @@ jobs:
# echo "MAMBA_EXE=$MAMBA_EXE"
# python test/test_path.py
# if: runner.os == 'macOS'

test_bash:
name: Test bash
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2

- name: install mamba
uses: ./
with:
environment-file: environment.yml
environment-name: myenv

- name: run python
run: |
python -VV
python -c "import numpy"
micromamba --help
- name: test environment name
run: |
python -c "import os; env = os.path.basename(os.environ['CONDA_PREFIX']); assert env == 'myenv'"
test_docker:
name: test
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
container: ["ubuntu:latest"]
steps:
- uses: actions/checkout@v3

- name: Install runtime dependencies
run: apt update && apt install -y curl bzip2

- name: install mamba
uses: ./

- name: run python in bash
shell: bash -l {0}
run: |
which micromamba
micromamba info
which python
python -VV
python -c "import numpy"
echo "MAMBA_EXE=$MAMBA_EXE"
python test/test_path.py
38 changes: 0 additions & 38 deletions .github/workflows/test_bash.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/test_extra-specs.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request: null

jobs:
test:
test_enviroment_file_and_enviroment_name:
name: Test options
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -106,3 +106,74 @@ jobs:
extra-specs: |
xtensor
channels: conda-forge,blah

test_environment_without_name:
name: "Test environment.yml without name: attribute"
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2

- name: install mamba
uses: ./
with:
environment-name: noname
environment-file: .github/workflows/resources/environment_without_name.yml

- run: micromamba list -n noname | grep -q xtensor
shell: bash

test_extra_specs:
name: Test extra-specs
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2

- name: install mamba
uses: ./
with:
environment-file: environment.yml
environment-name: myenv
extra-specs: |
click
sel(linux): xtensor
sel(osx): cmake
sel(win): ninja
- name: list environment
run: |
micromamba list
- name: check presence
if: runner.os == 'linux'
run: |
if ! micromamba list | grep -q click; then exit 1; fi
if ! micromamba list | grep -q xtensor; then exit 1; fi
if micromamba list | grep -q cmake; then exit 1; fi
if micromamba list | grep -q ninja; then exit 1; fi
- name: check presence
if: runner.os == 'macos'
run: |
if ! micromamba list | grep -q click; then exit 1; fi
if micromamba list | grep -q xtensor; then exit 1; fi
if ! micromamba list | grep -q cmake; then exit 1; fi
if micromamba list | grep -q ninja; then exit 1; fi
- name: check presence
if: runner.os == 'windows'
run: |
if ! micromamba list | grep -q click; then exit 1; fi
if micromamba list | grep -q xtensor; then exit 1; fi
if micromamba list | grep -q cmake; then exit 1; fi
if ! micromamba list | grep -q ninja; then exit 1; fi
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

GitHub Action to provision a CI instance using micromamba.

## Dependencies

`provision-with-micromamba` requires the `curl` and `tar` programs (with `bzip2` support).
They are preinstalled in the default GitHub Actions environments.

## Inputs

<!-- generated by generate-inputs-docs.js -->
Expand Down
Loading

0 comments on commit de032af

Please sign in to comment.