Skip to content

More maintenance

More maintenance #579

Workflow file for this run

name: Basic library (ipfs_client) build
on:
pull_request:
workflow_dispatch:
release:
types: [published]
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@v4
with:
files: build/library/cov.info
- name: Run Doxygen
run: ./ipfs_chromium/.github/doc.sh
- name: UpDoc
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/doc/html
repository-name: little-bear-labs/ipfs-chromium
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: "Ubuntu-Clang",
os: ubuntu-latest,
build_type: "Release",
cc: "clang",
cxx: "clang++",
generators: "Ninja"
}
- {
name: "Windows-MSVC",
os: windows-latest,
build_type: "Release",
cc: "cl",
cxx: "cl",
generators: "Visual Studio 17 2022"
}
steps:
- uses: actions/checkout@v4
- 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: |
set -ex
brew install cmake
brew install ninja
brew install conan
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++
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
conan profile show
ninja --version
cmake --version
conan --version
- name: Configure
shell: bash
run: |
mkdir build
mkdir ipfs-client-dev
if which ${{ matrix.config.cc }}
then
CC=`which ${{ matrix.config.cc }}`
export CC
fi
if which ${{ matrix.config.cxx }}
then
CXX=`which ${{ matrix.config.cxx }}`
export CXX
fi
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' || github.event_name == 'workflow_dispatch') && matrix.config.build_type == 'Release'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
cd build
python3 ../cmake/release.py