From bf16255657d178b548c8142cdd29742ab568e4b2 Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Mon, 24 Jul 2023 16:00:04 +0200 Subject: [PATCH] Cache Conda packages in CI --- .github/workflows/build_and_test.yml | 11 +++++++++++ .github/workflows/e2e-test.yml | 11 +++++++++++ .github/workflows/format_and_lint_ui.yml | 11 +++++++++++ 3 files changed, 33 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 2382b9b54..945e055a6 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -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: | diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index a5d45cd77..c2f01250e 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -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: | diff --git a/.github/workflows/format_and_lint_ui.yml b/.github/workflows/format_and_lint_ui.yml index 866e5a689..c6838ab24 100644 --- a/.github/workflows/format_and_lint_ui.yml +++ b/.github/workflows/format_and_lint_ui.yml @@ -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: |