Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull committed Aug 19, 2024
1 parent da948ca commit 9dd5231
Showing 1 changed file with 40 additions and 38 deletions.
78 changes: 40 additions & 38 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,48 @@ jobs:
name: build_with_clang
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest]
env:
# Indicates the location of the vcpkg as a Git submodule of the project repository.
# Not using "VCPKG_ROOT" because a variable with the same name is defined in the VS's
# Developer Command Prompt environment in VS 2022 17.6, which would override this one
# if it had the same name.
_VCPKG_: ${{ github.workspace }}/vcpkg
# Tells vcpkg where binary packages are stored.
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg/bincache
# Let's use GitHub Action cache as storage for the vcpkg Binary Caching feature.
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
steps:
- uses: actions/checkout@v2
- uses: actions/github-script@v7
with:
fetch-depth: 5
- name: Nightly default
run: rustup default nightly
- uses: actions/cache@v2
id: cache
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: actions/checkout@v4
with:
submodules: true
- name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
shell: bash
- name: Restore vcpkg
uses: actions/cache@v4
with:
# The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the
# built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var.
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
path: |
/home/runner/.hunter
/Users/runner/.hunter/
ccache
key: hunter-clang-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
hunter-clang-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
hunter-clang-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-
hunter-clang-v3-notest-${{ runner.temp }}-
${{ env._VCPKG_ }}
!${{ env._VCPKG_ }}/buildtrees
!${{ env._VCPKG_ }}/packages
!${{ env._VCPKG_ }}/downloads
!${{ env._VCPKG_ }}/installed
# The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
key: |
${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}
- name: Nightly default
run: rustup default nightly
- name: install macOS dependencies
if: runner.os == 'macOS'
run: brew install ccache
Expand All @@ -66,15 +88,8 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- uses: actions/cache@v2
id: cache
with:
path: /home/runner/.hunter
key: hunter-gcc-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
hunter-gcc-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
hunter-gcc-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-
hunter-gcc-v2-notest-${{ runner.temp }}-
- name: Setup (or from cache) vcpkg
uses: lukka/run-vcpkg@v11
- uses: actions/cache@v2
id: ccache
with:
Expand Down Expand Up @@ -108,21 +123,8 @@ jobs:
with:
toolchain: nightly-2021-06-17
override: true
- uses: actions/cache@v2
id: cache
with:
path: |
/home/runner/.hunter
/github/home/.hunter
/home/runner/.hunter/_Base/Download/
/github/home/.hunter/_Base/Download/
deps/src
ccache
key: hunter-centos-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
hunter-centos-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
hunter-centos-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-
hunter-centos-v2-notest-${{ runner.temp }}-
- name: Setup (or from cache) vcpkg
uses: lukka/run-vcpkg@v11
- name: install CentOS dependencies
run: |
yum install -y -q epel-release centos-release-scl flex bison patch glibc-static glibc-devel libzstd-devel
Expand Down

0 comments on commit 9dd5231

Please sign in to comment.