fix: solver name conflict #362
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: ci-test | |
on: | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
delint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install repo | |
run: | | |
pip install -e .[dev] | |
- name: Lint with precommit | |
run: | | |
pre-commit run --all-files | |
run-tests: | |
runs-on: ubuntu-latest | |
environment: cicd | |
env: | |
GIST_ID: ${{ vars.GIST_ID}} | |
container: | |
image: ghcr.io/transition-zero/tz-highs/highs-python:latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install jq | |
uses: dcarbone/[email protected] | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install repo | |
run: | | |
pip install -e .[dev] | |
- name: Test with pytest and capture coverage | |
run: | | |
pytest --cov=tz --cov-report=json:coverage.json | |
- name: parse coverage report | |
id: show_coverage_val | |
run: | | |
jq '.totals.percent_covered' coverage.json | |
- name: parse coverage report | |
id: extract_coverage_val | |
run: | | |
echo "COVERAGE=$(jq '.totals.percent_covered' coverage.json)" >> $GITHUB_ENV | |
- name: substring coverage | |
id: substring_coverage | |
run: | | |
coverage_int=$(echo "${{ env.COVERAGE }}" | cut -c 1-2) | |
echo "coverage_int=$coverage_int" >> $GITHUB_OUTPUT | |
- name: Create the Badge | |
uses: schneegans/[email protected] | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: ${{vars.GIST_ID}} | |
filename: coverage_badge.json | |
label: coverage | |
message: "%${{ steps.substring_coverage.outputs.coverage_int }}" | |
valColorRange: ${{ env.COVERAGE }} | |
maxColorRange: 100 | |
minColorRange: 50 |