CMake on multiple platforms #5
This file contains hidden or 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
| # This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. | |
| # See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml | |
| name: CMake on multiple platforms | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| VCPKG_DEFAULT_TRIPLET: ${{ matrix.arch }}-${{ matrix.triplet_platform}}${{ matrix.arch == 'x64' && '-release' || '' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-22.04, windows-latest] | |
| arch: [x86, x64] | |
| include: | |
| - os: windows-latest | |
| triplet_platform: windows-static # Windows static-release triplets have incorrect Run Time Linkage so just use static | |
| - os: ubuntu-22.04 | |
| triplet_platform: linux | |
| exclude: | |
| - os: ubuntu-22.04 | |
| arch: x86 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: lukka/get-cmake@latest | |
| - name: Install OS dependencies | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| run: sudo apt install -y build-essential g++ python3 zip unzip tar curl | |
| - name: Setup VCPKG | |
| uses: lukka/run-vcpkg@v11 | |
| - name: Run CMake consuming CMakePreset.json and run vcpkg to build packages | |
| uses: lukka/run-cmake@v10 | |
| with: | |
| configurePreset: ci | |
| buildPreset: ci-build | |
| - name: Store Build Output | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.VCPKG_DEFAULT_TRIPLET }} | |
| path: | | |
| ${{ github.workspace }}/ase/ase/bin | |
| ${{ github.workspace }}/test-executable/ | |
| ${{ github.workspace }}/build/vcpkg_installed/**/share |