From 6887e5ad74d5c8a311fb4b1cc5e126aead27020f Mon Sep 17 00:00:00 2001 From: AntoinePrv Date: Mon, 9 Oct 2023 12:00:46 +0200 Subject: [PATCH 1/4] Add script test --- .github/workflows/test..yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/test..yml diff --git a/.github/workflows/test..yml b/.github/workflows/test..yml new file mode 100644 index 0000000..b588258 --- /dev/null +++ b/.github/workflows/test..yml @@ -0,0 +1,38 @@ +name: Test install scripts + +on: + push: + branches: + - main + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test_install: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - {os: ubuntu-latest, shell: bash, shell-source-param: -i} + - {os: macos-latest, shell: zsh, shell-source-param: -i} + - {os: macos-latest, shell: bash, shell-source-param: -l} + - {os: windows-latest, shell: bash, shell-source-param: -l} + steps: + - name: Install Micromamba (${{ matrix.os }}, ${{ matrix.shell }}) + # Need to force the shell to get the default *calling* shell right + run: | + ${{ matrix.shell }} ./install.sh + - name: Test Micromamba + # use either -l or -i to source .bash_profile or .bashrc/.zshrc + run: | + ${{ matrix.shell }} ${{ matrix.shell-source-param }} -ec micromamba + - name: Test Micromamba + # use either -l or -i to source .bash_profile or .bashrc/.zshrc + run: | + ${{ matrix.shell }} ${{ matrix.shell-source-param }} -ec micromamba From 2b3624ce1ac4478eb5a9dd00ad42292d43329f60 Mon Sep 17 00:00:00 2001 From: AntoinePrv Date: Mon, 9 Oct 2023 12:03:05 +0200 Subject: [PATCH 2/4] Checkout repository --- .github/workflows/{test..yml => test.yml} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename .github/workflows/{test..yml => test.yml} (89%) diff --git a/.github/workflows/test..yml b/.github/workflows/test.yml similarity index 89% rename from .github/workflows/test..yml rename to .github/workflows/test.yml index b588258..9b028f9 100644 --- a/.github/workflows/test..yml +++ b/.github/workflows/test.yml @@ -24,10 +24,12 @@ jobs: - {os: macos-latest, shell: bash, shell-source-param: -l} - {os: windows-latest, shell: bash, shell-source-param: -l} steps: + - name: Checkout repository + uses: actions/checkout@v4 - name: Install Micromamba (${{ matrix.os }}, ${{ matrix.shell }}) # Need to force the shell to get the default *calling* shell right run: | - ${{ matrix.shell }} ./install.sh + ${{ matrix.shell }} -c '${{ matrix.shell }} ./install.sh' - name: Test Micromamba # use either -l or -i to source .bash_profile or .bashrc/.zshrc run: | From c749cfbe4278316495ea2987de51b6ed9d203b52 Mon Sep 17 00:00:00 2001 From: AntoinePrv Date: Mon, 9 Oct 2023 15:48:12 +0200 Subject: [PATCH 3/4] Fix shell forcing --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9b028f9..6052001 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: - name: Install Micromamba (${{ matrix.os }}, ${{ matrix.shell }}) # Need to force the shell to get the default *calling* shell right run: | - ${{ matrix.shell }} -c '${{ matrix.shell }} ./install.sh' + ${{ matrix.shell }} -c 'cat ./install.sh | ${SHELL}' - name: Test Micromamba # use either -l or -i to source .bash_profile or .bashrc/.zshrc run: | From e1fa7259af5504e728de08654397d9bfc0b2e337 Mon Sep 17 00:00:00 2001 From: AntoinePrv Date: Mon, 9 Oct 2023 16:16:46 +0200 Subject: [PATCH 4/4] Test environment creation --- .github/workflows/test.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6052001..8417e79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,19 @@ jobs: # use either -l or -i to source .bash_profile or .bashrc/.zshrc run: | ${{ matrix.shell }} ${{ matrix.shell-source-param }} -ec micromamba - - name: Test Micromamba + - name: Test Micromamba is found # use either -l or -i to source .bash_profile or .bashrc/.zshrc run: | - ${{ matrix.shell }} ${{ matrix.shell-source-param }} -ec micromamba + ${{ matrix.shell }} ${{ matrix.shell-source-param }} -ec micromamba --help + - name: Test Micromamba is found + # use either -l or -i to source .bash_profile or .bashrc/.zshrc + run: | + ${{ matrix.shell }} ${{ matrix.shell-source-param }} -ec micromamba --help + - name: Test create environment + # use either -l or -i to source .bash_profile or .bashrc/.zshrc + run: | + ${{ matrix.shell }} ${{ matrix.shell-source-param }} -ec micromamba create -c conda-forge -n test python + - name: Test activate environment + # use either -l or -i to source .bash_profile or .bashrc/.zshrc + run: | + ${{ matrix.shell }} ${{ matrix.shell-source-param }} -ec micromamba activate -n test