Hypothesis Tests #86
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: 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 | |
container: fedora:39 | |
timeout-minutes: 60 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
egress-policy: audit | |
- name: Install Linux Dependencies | |
run: > | |
dnf install -y gcc git graphviz pkg-config python-launcher upx | |
mutter dbus-x11 gtk4 gobject-introspection-devel | |
cairo-gobject-devel gtksourceview5-devel libadwaita-devel cairo-devel | |
python${{ env.python_version }}-devel | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set ownership of checkout directory | |
run: chown -R $(id -u):$(id -g) $PWD | |
- name: Use Python Dependency Cache | |
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-39 | |
- name: Use Hypothesis Cache | |
id: restore-cache | |
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | |
with: | |
path: .hypothesis | |
key: ${{ runner.os }}-hypothesis | |
- name: Install Dependencies | |
uses: ./.github/actions/install | |
with: | |
python-command: python${{ env.python_version }} | |
- name: Test with Hypothesis | |
env: | |
XDG_RUNTIME_DIR: /tmp | |
run: | | |
eval $(dbus-launch --auto-syntax) | |
mutter --wayland --no-x11 --sm-disable --headless -- poetry run pytest --cov | |
- name: Create Issue on Failure | |
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2 | |
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@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | |
if: always() | |
with: | |
path: .hypothesis | |
key: steps.restore-cache.output.key |