Skip to content

nokey

nokey #3

name: Linux Build-Test
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Release]
c_compiler: [gcc]
cpp_compiler: [g++]
steps:
# - uses: actions/checkout@v3
# # Add ssh-key to clone repository cadical
# - uses: webfactory/ssh-agent@v0.9.0
# with:
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Install libarchive
run: |
sudo apt install libarchive-dev
shell: bash
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Run tests
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }}
- name: Build manylinux wheels
working-directory: ${{ github.workspace }}
run: |
chmod a+x build-wheels.sh
mkdir wheelhouse
export DOCKER_IMAGE=quay.io/pypa/manylinux_2_28_x86_64
docker pull $DOCKER_IMAGE
docker run --rm -v ${{ github.workspace }}:/io $DOCKER_IMAGE /io/build-wheels.sh
if: startsWith(github.ref, 'refs/tags/')
- name: Publish package to TestPyPI
shell: bash
run: |
pip install twine
export TWINE_USERNAME="__token__"
export TWINE_PASSWORD="${{ secrets.TEST_PYPI_API_TOKEN }}"
twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ wheelhouse/* --verbose
if: startsWith(github.ref, 'refs/tags/')