Skip to content

Fix track usage example and replaced old options #122

Fix track usage example and replaced old options

Fix track usage example and replaced old options #122

name: Build and Test
# Workflow is triggered only on push to the master branch or a pull request to
# the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
debug_enabled:
description: 'Enable debug mode with tmate session'
required: false
default: 'false'
type: boolean
jobs:
install-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
# Fix ownership of the checkout dir
- name: Set ownership
run: |
chown -R $(id -u):$(id -g) $PWD
# Do not use ubuntu image for python setup
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install test dependencies
run: |
python -m pip install flake8 mypy build
- name: Lint with flake8
run: |
flake8 . --exclude 'docs/source/conf.py' --count --statistics
- name: Type check with mypy
run: |
mypy newmap tests
- name: Build AvxWindowFmIndex libraries
run: |
./build_libraries.sh
- name: Build wheel
run: |
python -m build --wheel
- uses: actions/upload-artifact@v4
with:
name: newmap-test-build
path: dist/*
- name: Install from wheel
run: |
python --version
python -m pip install -v dist/*.whl
python -m pip list
python -m pip show -f newmap
- name: Allow core dumps
run: |
# Enable access to core dumps
sudo mkdir /cores
sudo chmod 777 /cores
sudo bash -c 'echo "/cores/%e.%p.%t" > /proc/sys/kernel/core_pattern'
- name: Run tests
run: |
# Allow core dumps to be generated
ulimit -c unlimited
# Make sure to be running newmap from installed site-packages
cd tests
python -m unittest discover
./run_all.sh
- uses: actions/upload-artifact@v4
if: ${{ failure() }} # Only on failure attempt to upload core dump
with:
name: core-dumps
path: /cores
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled && failure() }}
build-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install cibuildwheel
run: |
python -m pip install --upgrade cibuildwheel
- name: Build AvxWindowFmIndex libraries
run: |
./build_libraries.sh
- name: Build wheel(s)
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: newmap-build
path: wheelhouse/*
- name: Run integration test
run: |
python -m pip install wheelhouse/*.whl