-
Notifications
You must be signed in to change notification settings - Fork 2
103 lines (96 loc) · 3.21 KB
/
tests-c.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CTests
on:
release:
types: [published]
push:
branches:
- main
pull_request:
jobs:
integration-test-linux:
strategy:
matrix:
containers:
- 1.21.4-bullseye
runs-on: ubuntu-22.04
container: golang:${{matrix.containers}}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: |
apt-get update
apt-get install -y cmake libcjson-dev
# without this line `git status` does not work on containers
# 1.19.5 and upper
git config --global --add safe.directory `pwd`
go build -buildmode=c-archive -o ios/libpolygonid.a ./cmd/polygonid
cp ios/libpolygonid.h ios/libpolygonid-darwin-arm64.h
mkdir examples/build
cd examples/build
cmake ..
make
make test ARGS="--rerun-failed --output-on-failure"
integration-test-macos:
runs-on: macos-12
if: github.event_name == 'push' || github.event_name == 'release'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: 1.21.1
- uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/Library/Caches/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run ctests
run: |
go build -buildmode=c-archive -o ios/libpolygonid.a ./cmd/polygonid
cp ios/libpolygonid.h ios/libpolygonid-darwin-arm64.h
brew install cjson
mkdir examples/build
cd examples/build
cmake ..
make
make test ARGS="--rerun-failed --output-on-failure"
- name: Check the ios-arm64 build
run: make ios-arm64
- name: Check the ios-simulator build
run: make ios-simulator
- name: Check the android-armeabi-v7a build
run: make android-armeabi-v7a
- name: Check the android-arm64-v8a build
run: make android-arm64-v8a
- name: Check the android-x86 build
run: make android-x86
- name: Check the android-x86-64 build
run: make android-x86-64
- name: Create multiplatform bundle for iOS
if: github.event_name == 'release'
run: make ios
- name: Prepare release artifacts
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
run: |
set -x
mkdir libpolygonid-${{ github.ref_name }}
cp -r ios android libpolygonid-${{ github.ref_name }}/
zip -r libpolygonid-${{ github.ref_name }}.zip libpolygonid-${{ github.ref_name }}
gh release upload ${{ github.event.release.tag_name }} libpolygonid-${{ github.ref_name }}.zip
# These steps goes after archiving release artifacts as I don't want to
# put these libs into release zip.
- name: Check the dylib build
run: make dylib
- name: Check the darwin-arm64 build
run: make darwin-arm64