fix: flags requiring explicit values #562
Workflow file for this run
This file contains hidden or 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: Development | |
on: push | |
jobs: | |
setup-requirements: | |
name: Get Requirements | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/setup-python@v5.3.0 | |
with: | |
python-version: "3.12.0" | |
- name: Check out repository code | |
uses: actions/checkout@v4.2.2 | |
- name: Install Hatch | |
run: python -m pip install --upgrade hatch | |
- name: Get Hatch Dependency Hash | |
run: echo "HATCH_DEP_HASH=$(hatch dep hash)" >> $GITHUB_ENV | |
- name: Cache Hatch environment | |
uses: actions/cache@v4.2.3 | |
with: | |
path: | | |
~/.cache/hatch | |
~/.local/share/hatch | |
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | |
- name: Generate Requirements | |
run: python -m hatch dep show requirements > requirements.txt | |
# Upload requirements to have them | |
- name: Upload Requirements | |
uses: actions/upload-artifact@v4.4.3 | |
with: | |
name: requirements | |
path: requirements.txt | |
pylint: | |
name: PyLint | |
runs-on: ubuntu-latest | |
needs: setup-requirements | |
timeout-minutes: 10 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4.2.2 | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/setup-python@v5.3.0 | |
with: | |
python-version: "3.12.0" | |
- name: Install Hatch | |
if: steps.cache-hatch.outputs.cache-hit != 'true' | |
run: python -m pip install --upgrade hatch | |
- name: Cache Hatch environment | |
uses: actions/cache@v4.2.3 | |
with: | |
path: | | |
~/.cache/hatch | |
~/.local/share/hatch | |
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | |
# Don't fail just output, since we want the score to be above 9 not 10.0 | |
# Don’t let the Perfect be the Enemy of the Good | |
- name: Pylint on esbmc_ai | |
run: hatch run pylint esbmc_ai || true | |
# Check if pass, the test command only takes integers so truncate decimals | |
- name: Check If Pass (90%) | |
run: | | |
SCORE="$(sed -n '$s/[^0-9]*\([0-9.]*\).*/\1/p' <<< "$(hatch run pylint esbmc_ai)")" | |
test "${SCORE%.*}" -ge 9 | |
test: | |
name: PyTest | |
needs: setup-requirements | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4.2.2 | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/setup-python@v5.3.0 | |
with: | |
python-version: "3.12.0" | |
- name: Install Hatch | |
if: steps.cache-hatch.outputs.cache-hit != 'true' | |
run: python -m pip install --upgrade hatch | |
- name: Cache Hatch environment | |
uses: actions/cache@v4.2.3 | |
with: | |
path: | | |
~/.cache/hatch | |
~/.local/share/hatch | |
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | |
- name: Run test suite | |
run: hatch test | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: setup-requirements | |
timeout-minutes: 10 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4.2.2 | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/setup-python@v5.3.0 | |
with: | |
python-version: "3.12.0" | |
- name: Install Hatch | |
if: steps.cache-hatch.outputs.cache-hit != 'true' | |
run: python -m pip install --upgrade hatch | |
- name: Cache Hatch environment | |
uses: actions/cache@v4.2.3 | |
with: | |
path: | | |
~/.cache/hatch | |
~/.local/share/hatch | |
key: ${{ runner.os }}-hatch-${{ env.HATCH_DEP_HASH }} | |
- name: Hatch build | |
run: hatch build | |
- name: Upload build files | |
uses: actions/upload-artifact@v4.4.3 | |
with: | |
name: build | |
path: dist |