Github actions: Update 0 #10
Workflow file for this run
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
name: Build | |
on: [push, pull_request] | |
env: | |
SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache | |
jobs: | |
mac-os: | |
strategy: | |
fail-fast: false | |
matrix: | |
xcode: ['13', '14'] | |
build_type: [Debug, Release] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-deps | |
with: | |
path: .cache/deps | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/ThirdPartyDeps.cmake') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Cache build | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-build | |
with: | |
path: .cache/sccache | |
key: ${{ runner.os }}-build-${{ env.cache-name }} | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: ${{ matrix.xcode }} | |
- name: Install sccache | |
run: brew install sccache | |
- name: CMake configure | |
run: cmake -B build | |
- working-directory: build/ | |
run: cmake --build . --config ${{ matrix.build_type }} | |
- working-directory: build/ | |
run: ctest --config ${{ matrix.build_type }} --output-on-failure | |
linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: | |
- g++-9 | |
- g++-10 | |
- clang++-10 | |
- clang++-11 | |
build_type: [ Debug, Release ] | |
runs-on: ubuntu-20.04 | |
env: | |
CXX: ${{ matrix.compiler }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-deps | |
with: | |
path: .cache/deps | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/ThirdPartyDeps.cmake') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Cache build | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-build | |
with: | |
path: .cache/sccache | |
key: ${{ runner.os }}-build-${{ env.cache-name }} | |
- name: Install sccache | |
run: | | |
curl -SL https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz | tar xvz --strip-components=1 --wildcards "*/sccache" | |
chmod +x sccache | |
- run: cmake -E make_directory build | |
- working-directory: build/ | |
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
- working-directory: build/ | |
run: cmake --build . | |
- working-directory: build/ | |
run: ctest --output-on-failure | |
windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
build_type: [Debug, Release] | |
runs-on: windows-2019 | |
env: | |
CXX: ${{ matrix.compiler }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-deps | |
with: | |
path: .cache/deps | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/ThirdPartyDeps.cmake') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Cache build | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-build | |
with: | |
path: .cache/sccache | |
key: ${{ runner.os }}-build-${{ env.cache-name }} | |
- name: Install sccache | |
run: choco install sccache | |
- run: cmake -E make_directory build | |
- shell: bash | |
working-directory: build/ | |
run: cmake $GITHUB_WORKSPACE | |
- working-directory: build/ | |
run: cmake --build . --config ${{ matrix.build_type }} | |
- working-directory: build/ | |
run: ctest -C ${{ matrix.build_type }} --output-on-failure | |
wheels: | |
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
needs: [mac-os, linux, windows] | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ 'windows-2019', 'ubuntu-latest', 'macos-latest' ] | |
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: "git: Add safe directory" | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: pip install build twine | |
- name: Run build | |
run: python -m build | |
- uses: actions/upload-artifact@v3 | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
name: Upload artifact (wheels) | |
with: | |
name: wheels | |
path: ./dist/*.whl | |