Skip to content

Commit

Permalink
Can I cache without artifacts?
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclary authored Jul 21, 2023
1 parent 8b38c93 commit d224c3d
Showing 1 changed file with 23 additions and 31 deletions.
54 changes: 23 additions & 31 deletions .github/workflows/installers-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ jobs:
DISTDIR: ${{ github.workspace }}/installers-conda/dist
pkg: ${{ matrix.pkg }}
artifact_name: ${{ matrix.pkg }}_${{ matrix.python-version }}
CONDA_BLD_PATH: ${{ github.workspace }}/installers-conda/build/conda-bld

steps:
- name: Checkout Code
Expand All @@ -126,21 +127,12 @@ jobs:
id: cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/installers-conda/dist
path: ${{ env.CONDA_BLD_PATH }}/**.tar.bz2
key: ${{ env.pkg }}_${{ hashFiles(format('external-deps/{0}/.gitrepo', env.pkg)) }}

- name: Build ${{ matrix.pkg }} Conda Package
if: steps.cache.outputs.cache-hit != 'true'
run: |
python build_conda_pkgs.py --build $pkg
mkdir -p dist
tar -a -C $CONDA_PREFIX -cf $PWD/dist/${artifact_name}.tar.bz2 conda-bld
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/installers-conda/dist/${{ env.artifact_name }}.tar.bz2
name: ${{ env.artifact_name }}
run: python build_conda_pkgs.py --build $pkg

build-installers:
name: Build installer for ${{ matrix.target-platform }} Python-${{ matrix.python-version }}
Expand All @@ -165,6 +157,7 @@ jobs:
MACOS_INSTALLER_CERTIFICATE: ${{ secrets.MACOS_INSTALLER_CERTIFICATE }}
APPLICATION_PWD: ${{ secrets.APPLICATION_PWD }}
CONSTRUCTOR_TARGET_PLATFORM: ${{ matrix.target-platform }}
CONDA_BLD_PATH: ${{ github.workspace }}/installers-conda/build/conda-bld
BNP_STATUS: ${{ needs.build-noarch-pkgs.result }}
MAT_STATUS: ${{ needs.build-matrix.result }}

Expand All @@ -183,26 +176,7 @@ jobs:
cache-environment: true

- name: Env Variables
run: |
ARTIFACTS_PATH=$RUNNER_TEMP/artifacts
CONDA_BLD_PATH=$RUNNER_TEMP/conda-bld
[[ -d $ARTIFACTS_PATH ]] || mkdir $ARTIFACTS_PATH
[[ -d $CONDA_BLD_PATH ]] || mkdir $CONDA_BLD_PATH
commit=$(python build_conda_packages.py --build spyder-kernels --get-commit)
echo "ARTIFACTS_PATH=$ARTIFACTS_PATH" >> $GITHUB_ENV
echo "CONDA_BLD_PATH=$CONDA_BLD_PATH" >> $GITHUB_ENV
echo "commit=$commit" >> $GITHUB_ENV
env | sort
- name: Download Local Conda Packages
if: needs.build-noarch-pkgs.result == 'success'
uses: actions/download-artifact@v3
with:
path: ${{ env.ARTIFACTS_PATH }}
run: env | sort

- name: Restore spyder-kernels Cache
id: cache
Expand All @@ -223,6 +197,24 @@ jobs:
path: ${{ env.CONDA_BLD_PATH }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Restore python-lsp-server Cache
if: env.IS_STANDARD_PR == 'true'
uses: actions/cache/restore@v3
with:
path: ${{ env.CONDA_BLD_PATH }}
key: python-lsp-server_${{ hashFiles('external-deps/python-lsp-server/.gitrepo') }}

- name: Restore qtconsole Cache
if: env.IS_STANDARD_PR == 'true'
uses: actions/cache/restore@v3
with:
path: ${{ env.CONDA_BLD_PATH }}
key: python-lsp-server_${{ hashFiles('external-deps/python-lsp-server/.gitrepo') }}

- name: Check cache
run: |
ls -al $CONDA_BLD_PATH
- name: Build ${{ matrix.target-platform }} spyder Conda Package
if: env.IS_STANDARD_PR == 'true'
run: python build_conda_pkgs.py --build spyder
Expand Down

0 comments on commit d224c3d

Please sign in to comment.