Skip to content

Commit

Permalink
Cache Conda packages in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed Jul 26, 2023
1 parent 3ee46f9 commit 59f2c5a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 13 deletions.
37 changes: 24 additions & 13 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,41 @@ jobs:
- name: Install LDAP dependencies
run: sudo apt-get -y install libsasl2-dev libldap2-dev libssl-dev

- name: Cache Conda packages
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-environment.yml') }}
env:
CACHE_NUMBER: 0 # increase to reset cache if `conda-environment.yml` has not changed

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: mxcubeweb
auto-activate-base: false
auto-update-conda: true
channel-priority: strict
environment-file: conda-environment.yml
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: true

- name: Install dependencies
run: |
pip install -e .
npm install --prefix ./ui
- name: Lint with flake8
run: |
#conda install flake8
# stop the build if there are Python syntax errors or undefined names
#flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
#flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
conda install pytest
conda install pytest-cov
pytest
- name: Lint with flake8
run: |
#conda install flake8
# stop the build if there are Python syntax errors or undefined names
#flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
#flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
conda install pytest
conda install pytest-cov
pytest
11 changes: 11 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,25 @@ jobs:
- name: Install LDAP dependencies
run: sudo apt-get -y install libsasl2-dev libldap2-dev libssl-dev

- name: Cache Conda packages
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-environment.yml') }}
env:
CACHE_NUMBER: 0 # increase to reset cache if `conda-environment.yml` has not changed

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: mxcubeweb
auto-activate-base: false
auto-update-conda: true
channel-priority: strict
environment-file: conda-environment.yml
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: true

- name: Install dependencies
run: |
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/format_and_lint_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,25 @@ jobs:
- name: Install LDAP dependencies
run: sudo apt-get -y install libsasl2-dev libldap2-dev libssl-dev

- name: Cache Conda packages
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-environment.yml') }}
env:
CACHE_NUMBER: 0 # increase to reset cache if `conda-environment.yml` has not changed

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: mxcubeweb
auto-activate-base: false
auto-update-conda: true
channel-priority: strict
environment-file: conda-environment.yml
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: true

- name: Install dependencies
run: |
Expand Down

0 comments on commit 59f2c5a

Please sign in to comment.