Skip to content

Sometimes run with and without MABWiser (#176) #191

Sometimes run with and without MABWiser (#176)

Sometimes run with and without MABWiser (#176) #191

Workflow file for this run

name: ALNS
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ created ]
jobs:
build:
name: >
Build and test ALNS using Python ${{ matrix.python-version }} and "${{ matrix.extras }}"
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [ '3.9', '3.12' ]
extras: [ '--all-extras', '' ]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Update pip and poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Cache Python dependencies
uses: actions/cache@v4
id: cache-python
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ matrix.extras }}
- name: Install Python dependencies
if: steps.cache-python.outputs.cache-hit != 'true'
run: poetry install ${{ matrix.extras }}
- name: Cache pre-commit
uses: actions/cache@v4
id: cache-pre-commit
with:
path: ~/.cache/pre-commit/
key: pre-commit-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
if: steps.cache-pre-commit.outputs.cache-hit != 'true'
run: poetry run pre-commit install --install-hooks
- name: Run pytest
run: poetry run pytest
- name: Run pre-commit
run: poetry run pre-commit run --all-files
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
deploy:
needs: build
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Update pip and poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Deploy to PyPI
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry build
poetry publish