Skip to content

Commit

Permalink
GHA: setup CMake based build for CI coverage
Browse files Browse the repository at this point in the history
The lack of CI coverage for CMake based build caused the CMake builds to
diverge and regress compared to the SPM builds. Add a second test to
ensure that we keep the two build systems in sync.
  • Loading branch information
compnerd committed Mar 6, 2024
1 parent cc1dfa6 commit 19d560d
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

jobs:
build:
spm:
runs-on: windows-latest

strategy:
Expand All @@ -18,7 +18,7 @@ jobs:
tag: DEVELOPMENT-SNAPSHOT-2024-02-08-a
options: -Xswiftc "-I${env:SDKROOT}\..\..\..\..\..\..\Toolchains\0.0.0+Asserts\usr\include"

name: Swift ${{ matrix.tag }}
name: SPM - Swift ${{ matrix.tag }}

steps:
- uses: compnerd/gha-setup-swift@main
Expand All @@ -31,11 +31,49 @@ jobs:
- uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4 # v1.1.1
with:
repo: thebrowsercompany/firebase-cpp-sdk
version: tags/20230921.0
version: tags/20240306.0
file: firebase-windows-amd64.zip

- run: Expand-Archive -Path firebase-windows-amd64.zip -DestinationPath third_party/firebase-development
shell: powershell

- name: Build
run: swift build -v ${{ matrix.options }}

cmake:
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
include:
- branch: development
tag: DEVELOPMENT-SNAPSHOT-2024-02-08-a
options: -I${env:SDKROOT}\..\..\..\..\..\..\Toolchains\0.0.0+Asserts\usr\include

name: CMake - Swift ${{ matrix.tag }}

steps:
- uses: compnerd/gha-setup-vsdevenv@main

- uses: compnerd/gha-setup-swift@main
with:
tag: ${{ matrix.tag }}
branch: ${{ matrix.branch }}

- uses: actions/checkout@v3

- uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4 # v1.1.1
with:
repo: thebrowsercompany/firebase-cpp-sdk
version: tags/20240306.0
file: firebase-windows-amd64.zip

- run: Expand-Archive -Path firebase-windows-amd64.zip -DestinationPath third_party/firebase-development
shell: powershell

- name: Configure
run: cmake -B out -D CMAKE_BUILD_TYPE=Release -G Ninja -S ${{ github.workspace }} -D CMAKE_Swift_FLAGS="${{ matrix.options }}" -D SWIFT_FIREBASE_BUILD_EXAMPLES=NO

- name: Build
run: cmake --build out

0 comments on commit 19d560d

Please sign in to comment.