Skip to content

Commit

Permalink
Use vcpkg's internal github actions binary caching (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins authored Jul 24, 2023
1 parent 46c5b60 commit 55fb06a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- cron: '30 2 * * 1,4' # Every Monday and Thursday @ 2h30am UTC

env:
VCPKG_DEFAULT_BINARY_CACHE: /tmp/vcpkg-archives
VCPKG_INSTALLED_DIR: /tmp/vcpkg_installed
ARTIFACT_NAME: distribution

Expand Down Expand Up @@ -74,19 +73,12 @@ jobs:
- name: Checkout source
uses: actions/checkout@v3

- name: Create VCPKG binary asset folder
run: mkdir -p ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}

- name: Cache VCPKG binary assets
id: cache-vcpkg
uses: actions/cache@v3
- name: Get Github Action Cache Variables
uses: actions/github-script@v6
with:
key: "vcpkg-cache-\
[${{ matrix.platform[0] }}]-\
[${{ matrix.platform[2] }}]-\
${{ hashfiles('.env', 'vcpkg/manifest/vcpkg.json', 'vcpkg/overlay-ports/*', \
format('vcpkg/overlay-triplets/{0}.cmake', matrix.platform[2])) }}"
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Run cibuildwheel
uses: pypa/[email protected]
Expand All @@ -95,7 +87,9 @@ jobs:
CIBW_BUILD_FRONTEND: build
CIBW_BEFORE_ALL_LINUX: yum install -y zip flex bison gcc-gfortran
CIBW_ENVIRONMENT_LINUX: >
VCPKG_DEFAULT_BINARY_CACHE=/host/${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }}
ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }}
VCPKG_BINARY_SOURCES="clear;x-gha,readwrite"
VCPKG_TARGET_TRIPLET=${{ matrix.platform[2] }}
VCPKG_INSTALLED_DIR=${{ env.VCPKG_INSTALLED_DIR }}
LD_LIBRARY_PATH=${{ env.VCPKG_INSTALLED_DIR }}/${{ matrix.platform[2] }}/lib
Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ History
X.Y.Z (YYYY-MM-DD)
------------------
* Use ccache, if available (:pr:`50`)
* Use vcpkg's internal github actions binary caching (:pr:`49`)
* Generalise the opening and creation of Tables (:pr:`48`)
* Optimise storage and passing of TableProxy objects (:pr:`46`)
* Convert SAFE_TABLE_FUNCTOR from macro to template function (:pr:`45`)
Expand Down

0 comments on commit 55fb06a

Please sign in to comment.