Skip to content

Commit 1876988

Browse files
authored
Add download and environment caching (#38)
1 parent a2be56c commit 1876988

23 files changed

+190225
-6015
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dist/* linguist-generated=true
1+
dist/** linguist-generated=true

.github/workflows/build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build and lint
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request: null
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- run: |
14+
npm install
15+
npm run build
16+
git diff --exit-code
17+
18+
lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- run: |
23+
npm install
24+
npm run lint
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Generated by conda-lock.
2+
# platform: linux-64
3+
# input_hash: 998e5781b9db69d647b7a60df21f1d24d125dc81d1e32a2aada7aefb6bd7d477
4+
@EXPLICIT
5+
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81
6+
https://conda.anaconda.org/conda-forge/linux-64/libgomp-11.2.0-h1d223b6_12.tar.bz2#763c5ec8116d984b4a33342236d7da36
7+
https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-1_gnu.tar.bz2#561e277319a41d4f24f5c05a9ef63c04
8+
https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-11.2.0-h1d223b6_12.tar.bz2#d34efbb8d7d6312c816b4bb647b818b1
9+
https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.2.11-h36c2ea0_1013.tar.bz2#dcddf696ff5dfcab567100d691678e18
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Generated by conda-lock.
2+
# platform: osx-64
3+
# input_hash: d73572c6997a61acdd2cd69b693154ebe6d4a74fdf9a6fc0ea0f0be858dc326a
4+
@EXPLICIT
5+
https://conda.anaconda.org/conda-forge/osx-64/libzlib-1.2.11-h9173be1_1013.tar.bz2#a3a6a53beaa92c5cfe52ee3a198e78cc
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Generated by conda-lock.
2+
# platform: win-64
3+
# input_hash: d0dd90bb50512cf5f723c8fea07f6c42f234db358f3c3b262b8ababd219a13be
4+
@EXPLICIT
5+
https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.20348.0-h57928b3_0.tar.bz2#6d666b6ea8251231ff508062d1e41f9c
6+
https://conda.anaconda.org/conda-forge/win-64/vs2015_runtime-14.29.30037-h902a5da_6.tar.bz2#33d07ebe91062743eabc9e53a60d18e1
7+
https://conda.anaconda.org/conda-forge/win-64/vc-14.2-hb210afc_6.tar.bz2#c2aecbc9b00ba6f352e27d3d61fd31fb
8+
https://conda.anaconda.org/conda-forge/win-64/libzlib-1.2.11-h8ffe710_1013.tar.bz2#b28dd2488b4e5f892c67071acc1d0a8c

.github/workflows/options.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: options
1+
name: Test options
22
on:
33
push:
44
branches:
@@ -7,16 +7,21 @@ on:
77

88
jobs:
99
test:
10+
name: Test options
1011
runs-on: ${{ matrix.os }}
1112
strategy:
1213
fail-fast: false
1314
matrix:
1415
os: [windows-latest, ubuntu-latest, macos-latest]
1516
pytest: ["6.1", "6.2"]
16-
name: option
1717
steps:
1818
- uses: actions/checkout@v2
1919

20+
- name: install mamba
21+
uses: ./
22+
with:
23+
environment-file: false
24+
2025
- name: install mamba
2126
uses: ./
2227
with:
@@ -29,17 +34,19 @@ jobs:
2934
- name: run python in powershell
3035
shell: powershell
3136
run: |
37+
where micromamba
38+
micromamba info
3239
python -VV
3340
python -c "import numpy"
34-
micromamba --help
3541
if: runner.os == 'Windows'
3642

3743
- name: run python in bash
3844
shell: bash -l {0}
3945
run: |
46+
which micromamba
47+
micromamba info
4048
python -VV
4149
python -c "import numpy"
42-
micromamba --help
4350
if: runner.os != 'Windows'
4451

4552
- name: test environment name in powershell

.github/workflows/test.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test
1+
name: Basic tests
22
on:
33
push:
44
branches:
@@ -7,12 +7,12 @@ on:
77

88
jobs:
99
test:
10+
name: test
1011
runs-on: ${{ matrix.os }}
1112
strategy:
1213
fail-fast: false
1314
matrix:
1415
os: [windows-latest, ubuntu-latest, macos-latest]
15-
name: test
1616
steps:
1717
- uses: actions/checkout@v2
1818

@@ -22,42 +22,47 @@ jobs:
2222
- name: run python in powershell
2323
shell: powershell
2424
run: |
25+
which micromamba
26+
micromamba info
27+
which python
2528
python -VV
2629
python -c "import numpy"
2730
echo "MAMBA_EXE=$Env:MAMBA_EXE"
28-
which micromamba
2931
python test/test_path.py
3032
if: runner.os == 'Windows'
3133

3234
- name: run python in cmd.exe
3335
shell: cmd /C call {0}
3436
run: |
37+
where micromamba
38+
micromamba info
39+
which python
3540
python -VV
3641
python -c "import numpy"
37-
micromamba --help
3842
echo "MAMBA_EXE=%MAMBA_EXE%"
39-
where micromamba
4043
python test/test_path.py
4144
if: runner.os == 'Windows'
4245

4346
- name: run python in bash
4447
shell: bash -l {0}
4548
run: |
49+
which micromamba
50+
micromamba info
51+
which python
4652
python -VV
4753
python -c "import numpy"
48-
micromamba --help
4954
echo "MAMBA_EXE=$MAMBA_EXE"
50-
which micromamba
5155
python test/test_path.py
5256
5357
# - name: run python in zsh
5458
# shell: zsh -l {0}
5559
# run: |
60+
# which micromamba
61+
# micromamba info
62+
# which python
5663
# python -VV
5764
# python -c "import numpy"
58-
# micromamba --help
5965
# micromamba activate test
6066
# echo "MAMBA_EXE=$MAMBA_EXE"
61-
# which micromamba
6267
# python test/test_path.py
63-
# if: runner.os == 'macOS'
68+
# if: runner.os == 'macOS'

.github/workflows/test_bash.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: bash
1+
name: Test bash
22
on:
33
push:
44
branches:
@@ -7,6 +7,7 @@ on:
77

88
jobs:
99
test:
10+
name: Test bash
1011
runs-on: ${{ matrix.os }}
1112
strategy:
1213
fail-fast: false
@@ -17,7 +18,6 @@ jobs:
1718
run:
1819
shell: bash -l {0}
1920

20-
name: bash
2121
steps:
2222
- uses: actions/checkout@v2
2323

@@ -35,4 +35,4 @@ jobs:
3535
3636
- name: test environment name
3737
run: |
38-
python -c "import os; env = os.path.basename(os.environ['CONDA_PREFIX']); assert env == 'myenv'"
38+
python -c "import os; env = os.path.basename(os.environ['CONDA_PREFIX']); assert env == 'myenv'"

.github/workflows/test_caching.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Test caching
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: null
8+
9+
defaults:
10+
run:
11+
shell: bash -l {0}
12+
13+
jobs:
14+
test_download1:
15+
name: Test download cache 1/2
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [windows-latest, ubuntu-latest, macos-latest]
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: install mamba
25+
uses: ./
26+
with:
27+
cache-downloads: true
28+
29+
- name: test environment name
30+
run: |
31+
python -c "import os; env = os.path.basename(os.environ['CONDA_PREFIX']); assert env == 'testenv'"
32+
33+
test_download2:
34+
name: Test download cache 2/2
35+
needs: [test_download1]
36+
runs-on: ${{ matrix.os }}
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
os: [windows-latest, ubuntu-latest, macos-latest]
41+
steps:
42+
- uses: actions/checkout@v2
43+
44+
- name: install mamba
45+
uses: ./
46+
with:
47+
cache-downloads: true
48+
49+
- name: test environment name
50+
run: |
51+
python -c "import os; env = os.path.basename(os.environ['CONDA_PREFIX']); assert env == 'testenv'"
52+
53+
test_env1:
54+
name: Test env cache 1/3
55+
runs-on: ${{ matrix.os }}
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
os: [windows-latest, ubuntu-latest, macos-latest]
60+
steps:
61+
- uses: actions/checkout@v2
62+
63+
- name: install mamba
64+
uses: ./
65+
with:
66+
cache-env: true
67+
68+
- name: test environment name
69+
run: |
70+
python -c "import os; env = os.path.basename(os.environ['CONDA_PREFIX']); assert env == 'testenv'"
71+
72+
test_env2:
73+
name: Test env cache 2/3
74+
needs: [test_env1]
75+
runs-on: ${{ matrix.os }}
76+
strategy:
77+
fail-fast: false
78+
matrix:
79+
os: [windows-latest, ubuntu-latest, macos-latest]
80+
steps:
81+
- uses: actions/checkout@v2
82+
83+
- name: install mamba
84+
uses: ./
85+
with:
86+
cache-env: true
87+
88+
- name: test environment name
89+
run: |
90+
python -c "import os; env = os.path.basename(os.environ['CONDA_PREFIX']); assert env == 'testenv'"
91+
92+
test_env3:
93+
if: false # Doesn't work
94+
name: Test env cache 3/3
95+
needs: [test_env1]
96+
runs-on: ${{ matrix.os }}
97+
strategy:
98+
fail-fast: false
99+
matrix:
100+
os: [windows-latest, ubuntu-latest, macos-latest]
101+
steps:
102+
- uses: actions/checkout@v2
103+
104+
- name: install mamba
105+
uses: ./
106+
with:
107+
cache-env: true
108+
cache-env-always-update: true
109+
110+
- name: test environment name
111+
run: |
112+
python -c "import os; env = os.path.basename(os.environ['CONDA_PREFIX']); assert env == 'testenv'"

.github/workflows/test_lock.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test lock files
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request: null
7+
8+
jobs:
9+
test:
10+
name: Test lock files
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- os: windows-latest
17+
lock-file: conda-win-64.lock
18+
- os: ubuntu-latest
19+
lock-file: conda-linux-64.lock
20+
- os: macos-latest
21+
lock-file: conda-osx-64.lock
22+
os: [windows-latest, ubuntu-latest, macos-latest]
23+
defaults:
24+
run:
25+
shell: bash -l {0}
26+
steps:
27+
- uses: actions/checkout@v2
28+
29+
- name: install from lockfile
30+
uses: ./
31+
with:
32+
environment-name: lock_test
33+
environment-file: .github/workflows/lockfiles/${{ matrix.lock-file }}
34+
35+
- name: test environment name
36+
run: |
37+
python -c "import os; env = os.path.basename(os.environ['CONDA_PREFIX']); assert env == 'lock_test'"

0 commit comments

Comments
 (0)