Skip to content

server: fix

server: fix #181

Workflow file for this run

name: kmindex
on:
push:
paths-ignore:
- '.github/workflows/doc.yml'
- 'README.md'
- 'docker/**'
- 'conda/**'
- 'scripts/**'
- '.gitignore'
- 'docs/kmindex/**'
pull_request:
paths-ignore:
- '.github/workflows/doc.yml'
- 'README.md'
- 'docker/**'
- 'conda/**'
- 'scripts/**'
- '.gitignore'
- 'docs/kmindex/**'
jobs:
build:
name: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.build_type }}
strategy:
fail-fast: false
matrix:
build_type: [Release]
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-14, macos-15-intel]
include:
- os: ubuntu-24.04
arch: x86_64
compiler: g++-13
cxx: g++-13
cc: gcc-13
- os: ubuntu-24.04-arm
arch: arm64
compiler: g++-13
cxx: g++-13
cc: gcc-13
- os: macos-14
arch: arm64
- os: macos-15-intel
arch: x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Linux dependencies
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y zlib1g zlib1g-dev ${{ matrix.compiler }} bzip2 libboost-all-dev libbz2-dev
- name: Install macOS dependencies
if: contains(matrix.os, 'macos')
run: brew install zlib cmake boost bzip2
- name: Configure
shell: bash
run: |
mkdir build
cd build
if [[ "${{ matrix.os }}" == ubuntu* ]]; then
export CC=$(which ${{ matrix.cc }})
export CXX=$(which ${{ matrix.cxx }})
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DWITH_TESTS=ON -DFMT_HEADER_ONLY=ON -DSPDLOG_HEADER_ONLY=ON -DSTATIC_BUILD=ON -DPORTABLE_BUILD=ON
else
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DWITH_TESTS=ON -DFMT_HEADER_ONLY=ON -DSPDLOG_HEADER_ONLY=ON -DWITH_SERVER=OFF -DPORTABLE_BUILD=ON
fi
- name: Build
shell: bash
run: |
cd build
make -j2
- name: Test
shell: bash
run: cd build && ctest --verbose
- name: Package
if: matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v')
shell: bash
run: cd build && make package
- name: Get tag
if: matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v')
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Collect files
if: matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v')
run: |
mkdir archive_files
if [[ "${{ matrix.os }}" == ubuntu* ]]; then
mv build/kmindex-${{ steps.tag.outputs.TAG }}-bin-Linux.tar.gz archive_files/kmindex-${{ steps.tag.outputs.TAG }}-Linux-${{ matrix.arch }}.tar.gz
else
mv build/kmindex-${{ steps.tag.outputs.TAG }}-bin-Darwin.tar.gz archive_files/kmindex-${{ steps.tag.outputs.TAG }}-macOS-${{ matrix.arch }}.tar.gz
fi
- name: Release
if: matrix.build_type == 'Release' && startsWith(github.event.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
release_name: Release ${{ steps.tag.outputs.TAG }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'archive_files/*'
file_glob: true
tag: ${{ github.ref }}
body: ""
prerelease: true