Run scratchattach script #142
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: Run scratchattach script | |
on: | |
workflow_dispatch: | |
inputs: | |
py_version: | |
description: "Python Version" | |
required: true | |
type: choice | |
options: | |
- "3.8" | |
- "3.10" | |
- "3.10.3" | |
- "3.11" | |
- "3.11.3" | |
- "3.12" | |
- "3.12.4" | |
- "3.12.5" | |
default: "3.12.5" | |
runner: | |
description: "Run on which OS?" | |
type: choice | |
required: true | |
options: | |
- "macos" | |
- "ubuntu" | |
- "windows" | |
default: "ubuntu" | |
pip: | |
description: "Update pip?" | |
type: boolean | |
required: true | |
default: true | |
run: | |
description: "Run which file?" | |
type: choice | |
required: true | |
options: | |
- "message_viewer.py" | |
- "scratch_chat.py" | |
default: "message_viewer.py" | |
schedule: | |
- cron: "00 */30 * * *" | |
jobs: | |
run1: | |
name: 'Run 1' | |
runs-on: "${{ github.events.inputs.runner == '' && 'ubuntu' || github.events.inputs.runner }}-latest" | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v4.1.7 # checkout the repository content to github runner | |
with: | |
ref: v1.4.3 | |
- name: setup python | |
uses: actions/setup-python@v5.2.0 | |
with: | |
python-version: "${{ github.events.inputs.py_version == '' && '3.12.5' || github.events.inputs.py_versions }}" # install the python version needed | |
- name: install scratchattach | |
uses: bossOfCode/install-scratchattach@v1.0.3 | |
- name: Generate UUID for cache | |
id: uuid | |
uses: bossOfCode/generate-uuid@v1.1 | |
- uses: actions/cache/save@v4.0.2 | |
if: startsWith(runner.os, 'Linux') | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ steps.uuid.outputs.uuid }} | |
- uses: actions/cache/save@v4.0.2 | |
if: startsWith(runner.os, 'macOS') | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ steps.uuid.outputs.uuid }} | |
- uses: actions/cache/save@v4.0.2 | |
if: startsWith(runner.os, 'Windows') | |
with: | |
path: ~\AppData\Local\pip\Cache | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ steps.uuid.outputs.uuid }} | |
- name: recheckout repo content | |
uses: actions/checkout@v4.1.7 # checkout the repository content to github runner | |
with: | |
ref: v1.4.3 | |
- name: execute ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} | |
run: | | |
python3 ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} | |
run2: | |
name: 'Run 2' | |
runs-on: "${{ github.events.inputs.runner == '' && 'ubuntu' || github.events.inputs.runner }}-latest" | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
if: ${{ success() }} | |
needs: run1 | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v4.1.7 # checkout the repository content to github runner | |
with: | |
ref: v1.4.3 | |
- name: 'Restore cache: Linux Runner' | |
if: startsWith(runner.os, 'Linux') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: 'Restore cache: Mac Runner' | |
if: startsWith(runner.os, 'macOS') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: 'Restore cache: Windows Runner' | |
if: startsWith(runner.os, 'windows') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~\AppData\Local\pip\Cache | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: reinstall scratchattach | |
uses: bossOfCode/install-scratchattach@v1.0.3 | |
- name: execute ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} | |
run: | | |
python3 ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} | |
run3: | |
name: 'Run 3' | |
runs-on: "${{ github.events.inputs.runner == '' && 'ubuntu' || github.events.inputs.runner }}-latest" | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
if: ${{ success() }} | |
needs: [run1, run2] | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v4.1.7 # checkout the repository content to github runner | |
with: | |
ref: v1.4.3 | |
- name: 'Restore cache: Linux Runner' | |
if: startsWith(runner.os, 'Linux') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: 'Restore cache: Mac Runner' | |
if: startsWith(runner.os, 'macOS') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: 'Restore cache: Windows Runner' | |
if: startsWith(runner.os, 'windows') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~\AppData\Local\pip\Cache | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: reinstall scratchattach | |
uses: bossOfCode/install-scratchattach@v1.0.3 | |
- name: execute ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} | |
run: | | |
python3 ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} | |
run4: | |
name: 'Run 4' | |
runs-on: "${{ github.events.inputs.runner == '' && 'ubuntu' || github.events.inputs.runner }}-latest" | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
if: ${{ success() }} | |
needs: [run1, run2, run3] | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v4.1.7 # checkout the repository content to github runner | |
with: | |
ref: v1.4.3 | |
- name: 'Restore cache: Linux Runner' | |
if: startsWith(runner.os, 'Linux') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: 'Restore cache: Mac Runner' | |
if: startsWith(runner.os, 'macOS') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: 'Restore cache: Windows Runner' | |
if: startsWith(runner.os, 'windows') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~\AppData\Local\pip\Cache | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: reinstall scratchattach | |
uses: bossOfCode/install-scratchattach@v1.0.3 | |
- name: execute ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} | |
run: | | |
python3 ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} | |
run5: | |
name: 'Run 5' | |
runs-on: "${{ github.events.inputs.runner == '' && 'ubuntu' || github.events.inputs.runner }}-latest" | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
if: ${{ success() }} | |
needs: [run1, run2, run3, run4] | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v4.1.7 # checkout the repository content to github runner | |
with: | |
ref: v1.4.3 | |
- name: 'Restore cache: Linux Runner' | |
if: startsWith(runner.os, 'Linux') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: 'Restore cache: Mac Runner' | |
if: startsWith(runner.os, 'macOS') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: 'Restore cache: Windows Runner' | |
if: startsWith(runner.os, 'windows') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~\AppData\Local\pip\Cache | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: reinstall scratchattach | |
uses: bossOfCode/install-scratchattach@v1.0.3 | |
- name: execute ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} | |
run: | | |
python3 ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} | |
run6: | |
name: 'Run 6' | |
runs-on: "${{ github.events.inputs.runner == '' && 'ubuntu' || github.events.inputs.runner }}-latest" | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
if: ${{ success() }} | |
needs: [run1, run2, run3, run4, run5] | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v4.1.7 # checkout the repository content to github runner | |
with: | |
ref: v1.4.3 | |
- name: 'Restore cache: Linux Runner' | |
if: startsWith(runner.os, 'Linux') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: 'Restore cache: Mac Runner' | |
if: startsWith(runner.os, 'macOS') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: 'Restore cache: Windows Runner' | |
if: startsWith(runner.os, 'windows') | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: ~\AppData\Local\pip\Cache | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ github.events.jobs.run1.steps.uuid.outputs.uuid }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: reinstall scratchattach | |
uses: bossOfCode/install-scratchattach@v1.0.3 | |
- name: execute ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} | |
run: | | |
python3 ${{ github.events.inputs.run == '' && 'message_viewer.py' || github.events.inputs.run }} |