-
Notifications
You must be signed in to change notification settings - Fork 1
139 lines (139 loc) · 4.36 KB
/
library.yml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Basic library (ipfs_client) build
on:
pull_request:
release:
types: [created]
jobs:
prechecks:
runs-on: ubuntu-latest
steps:
- name: Checkout ipfs_chromium
uses: actions/checkout@v4
with:
path: 'ipfs_chromium'
- name: Run Unit Tests
run: ./ipfs_chromium/.github/ut.sh
- name: Tour de IPFS
run: ./ipfs_chromium/.github/tour.sh
- name: Upload coverage reports to Codecov.com
uses: codecov/codecov-action@v3
with:
files: build/library/cov.info
build:
name: ${{ matrix.config.name }}
needs: [prechecks]
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: true
matrix:
config:
- {
name: "macOS",
os: macos-latest,
build_type: "Release",
cc: "clang",
cxx: "clang++",
generators: "Ninja"
}
- {
name: "Ubuntu",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc",
cxx: "g++",
generators: "Ninja"
}
- {
name: "Ubuntu-Debug",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja"
}
- {
name: "Windows-MSVC",
os: windows-latest,
build_type: "Release",
cc: "cl",
cxx: "cl",
generators: "Visual Studio 17 2022"
}
steps:
- uses: actions/checkout@v3
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
pwd
git status
which python3
python3 --version
- name: Install dependencies on Ubuntu
if: startsWith(matrix.config.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install --yes cmake ninja-build doxygen
ninja --version
cmake --version
g++ --version
- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'macos')
shell: bash
run: |
brew install cmake ninja
ninja --version
cmake --version
which c++
which clang++
c++ --version
clang++ --version
/usr/bin/clang++ --version
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade conan
conan profile detect
conan profile show
conan profile path default
grep -n . `conan profile path default`
echo "compiler=apple-clang" >> `conan profile path default`
echo "compiler.cppstd=20" >> `conan profile path default`
echo "compiler.libcxx=libc++" >> `conan profile path default`
echo "compiler.version=14.0" >> `conan profile path default`
conan profile show
- name: Install dependencies on Windows
if: startsWith(matrix.config.os, 'windows')
run: |
choco install ninja cmake
python3 -m pip install --upgrade pip
python3 -m pip install conan
conan profile detect
Copy-Item ".\.github\msvc.profile" -Destination "C:\Users\runneradmin\.conan2\profiles\default"
ninja --version
cmake --version
conan --version
- name: Configure
shell: bash
run: |
mkdir build
mkdir ipfs-client-dev
cmake \
-G "${{ matrix.config.generators }}" \
-S . \
-B build \
-D CMAKE_INSTALL_PREFIX=`pwd`/ipfs-client-dev \
-D CMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-D USE_DOXYGEN=OFF \
-D CXX_VERSION=20
- name: Build
shell: bash
run: cmake --build build --config ${{ matrix.config.build_type }} --target package
- name: Upload to release
if: github.event_name == 'release' && matrix.config.build_type == 'Release'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
cd build
python3 ../cmake/release.py --library-only