1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2024-12-01 08:09:15 +01:00

[examples] update conan example

This commit is contained in:
Andrew Marshall 2022-10-01 20:37:15 +01:00
parent 6e95cb56b9
commit 5d6684a94a

View file

@ -44,41 +44,49 @@
Using [Conan Lockfiles](https://docs.conan.io/en/latest/versioning/lockfiles.html): Using [Conan Lockfiles](https://docs.conan.io/en/latest/versioning/lockfiles.html):
```.yaml ```yaml
- name: create conan cache keys - name: create conan cache keys
run: | run: |
conan lock create conanfile.py --build missing conan lock create conanfile.py --build missing
- name: get conan cache
uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
~/.conan/data ~/.conan/data
!~/.conan/data/**/conan_sources.tgz
key: conan-${{ hashFiles('conan.lock') }} key: conan-${{ hashFiles('conan.lock') }}
- name: install conan dependencies
run: | run: |
conan install . --lockfile conan.lock --build missing conan install . --lockfile conan.lock --build missing
``` ```
For Windows, use
```yaml
- uses: actions/cache@v3
if: runner.os == 'Windows'
with:
path: |
~/.conan/data
C:/.conan
key: conan-${{ hashFiles('conan.lock') }}
```
Using a custom cache location, and a profile as a partial cache key: Using a custom cache location, and a profile as a partial cache key:
```.yaml ```yaml
env: env:
CONAN_USER_HOME: /tmp/ CONAN_USER_HOME: /tmp/
PROFILE: my_profile PROFILE: my_profile
- name: create lockfile - name: create lockfile
run: | run: |
conan lock create conanfile.py -pr $PROFILE --build missing conan lock create conanfile.py -pr $PROFILE --build missing
- name: get conan cache
uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: | path: |
${{ env.CONAN_USER_HOME }}/.conan/data ${{ env.CONAN_USER_HOME }}/.conan/data
!${{ env.CONAN_USER_HOME }}/.conan/data/**/conan_sources.tgz
key: conan-${{ env.PROFILE }}-${{ hashFiles('conan.lock') }} key: conan-${{ env.PROFILE }}-${{ hashFiles('conan.lock') }}
- name: install conan dependencies
run: |
conan install . --lockfile conan.lock --build missing
``` ```
## C# - NuGet ## C# - NuGet