Skip to content

Commit 886ebae

Browse files
authored
Add build tests to CI (firebase#4)
1 parent 4749670 commit 886ebae

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed

Diff for: .github/workflows/spm.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: spm
2+
3+
on:
4+
pull_request:
5+
schedule:
6+
# Run every day at 11pm (PST) - cron uses UTC times
7+
- cron: '0 7 * * *'
8+
9+
jobs:
10+
swiftpm-build-tests:
11+
runs-on: macOS-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Initialize xcodebuild
15+
run: xcodebuild -list
16+
- name: iOS Simulator Build Tests
17+
run: xcodebuild -scheme abseil build -sdk 'iphonesimulator' -destination 'platform=iOS Simulator,name=iPhone 11'
18+
- name: macos Build Tests
19+
run: xcodebuild -scheme abseil build -sdk 'macosx' -destination 'platform=OS X,arch=x86_64',
20+
- name: tvOS Build Tests
21+
run: xcodebuild -scheme abseil build -sdk "appletvsimulator" -destination 'platform=tvOS Simulator,name=Apple TV'
22+
- name: iOS Device Build Tests
23+
run: xcodebuild -scheme abseil build -sdk 'iphoneos'

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ CMakeLists.txt.user
1313
# Ignore generated python artifacts
1414
*.pyc
1515
copts/__pycache__/
16+
# SwiftPM build directory
17+
.swiftpm/

Diff for: Package.swift

+10
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,18 @@ let package = Package(
261261
publicHeadersPath: ".",
262262
cSettings: [
263263
.headerSearchPath("./"),
264+
],
265+
linkerSettings: [
266+
.linkedFramework("CoreFoundation"),
264267
]
265268
),
269+
.testTarget(
270+
name: "build-test",
271+
dependencies: [
272+
"abseil",
273+
],
274+
path: "SwiftPMTests/build-test"
275+
),
266276
],
267277

268278
cxxLanguageStandard: CXXLanguageStandard.gnucxx14

Diff for: SwiftPMTests/build-test/test.cc

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// absl imports from Firestore and gRPC
16+
17+
#include "absl/algorithm/container.h"
18+
#include "absl/base/attributes.h"
19+
#include "absl/base/call_once.h"
20+
#include "absl/base/casts.h"
21+
#include "absl/base/config.h"
22+
#include "absl/base/internal/endian.h"
23+
#include "absl/base/internal/unaligned_access.h"
24+
#include "absl/base/macros.h"
25+
#include "absl/base/optimization.h"
26+
#include "absl/base/port.h"
27+
#include "absl/container/flat_hash_map.h"
28+
#include "absl/container/inlined_vector.h"
29+
#include "absl/memory/memory.h"
30+
#include "absl/meta/type_traits.h"
31+
#include "absl/strings/ascii.h"
32+
#include "absl/strings/escaping.h"
33+
#include "absl/strings/match.h"
34+
#include "absl/strings/numbers.h"
35+
#include "absl/strings/str_cat.h"
36+
#include "absl/strings/str_format.h"
37+
#include "absl/strings/str_join.h"
38+
#include "absl/strings/str_replace.h"
39+
#include "absl/strings/str_split.h"
40+
#include "absl/strings/string_view.h"
41+
#include "absl/strings/strip.h"
42+
#include "absl/strings/substitute.h"
43+
#include "absl/synchronization/mutex.h"
44+
#include "absl/time/clock.h"
45+
#include "absl/time/time.h"
46+
#include "absl/types/any.h"
47+
#include "absl/types/optional.h"
48+
#include "absl/types/variant.h"

0 commit comments

Comments
 (0)