-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use vcpkg's internal github actions binary caching (#49)
- Loading branch information
Showing
2 changed files
with
9 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -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] | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters