Skip to content

Hypothesis Tests

Hypothesis Tests #26

name: Hypothesis Tests
on:
workflow_dispatch:
schedule:
# min hour dom month dow
- cron: '0 6 * * *'
env:
python_version: '3.11'
permissions:
issues: write
jobs:
hypothesis:
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Harden Runner
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
with:
egress-policy: audit
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Linux Dependencies
run: >
sudo apt-get update -qq && sudo apt-get install -qq --no-install-recommends upx
gir1.2-gtk-4.0 libgirepository1.0-dev libgtksourceview-5-dev libadwaita-1-dev
graphviz
- name: Set up Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: ${{ env.python_version }}
- name: Use Python Dependency Cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-20.04
- name: Use Hypothesis Cache
id: restore-cache
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: .hypothesis
key: ${{ runner.os }}-hypothesis
- name: Install Dependencies and Test
uses: ./.github/actions/setup_and_test
- name: Test with Hypothesis
run: xvfb-run poetry run pytest -m hypothesis --hypothesis-profile=ci
shell: bash
- name: Create Issue on Failure
uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd # v2.9.1
if: failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/hypothesis-test-failed.md
update_existing: true
- name: Save cache
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
if: always()
with:
path: .hypothesis
key: steps.restore-cache.output.key