This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
Add CI (#74) #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Update pip and poetry | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Cache Python dependencies | |
uses: actions/cache@v3 | |
id: cache-python | |
with: | |
path: ~/.cache/pypoetry | |
key: ${{ runner.os }}-${{ hashFiles('pyproject.toml') }} | |
- name: Install Python dependencies | |
if: steps.cache-python.outputs.cache-hit != 'true' | |
run: poetry install | |
- name: Cache pre-commit | |
uses: actions/cache@v3 | |
id: cache-pre-commit | |
with: | |
path: ~/.cache/pre-commit/ | |
key: pre-commit-${{ 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 pre-commit | |
run: poetry run pre-commit run --all-files | |
- name: Test run instance | |
run: poetry run benchmark instances/ortec/ORTEC-VRPTW-ASYM-01*.txt --epoch_tlim 1 --solve_tlim 5 |