Merge pull request #138 from Zoriot:birthday-typo #267
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: "Cog load test" | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
loadcheck: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.11"] | |
include: | |
- red-version: "git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=Red-DiscordBot" | |
friendly-red: "Red (dev version)" | |
- red-version: "Red-DiscordBot" | |
friendly-red: "Red (stable)" | |
fail-fast: false | |
name: Cog load test - Python ${{ matrix.python-version }} & ${{ matrix.friendly-red }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache venv | |
id: cache-venv | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: ${{ matrix.red-version }}-${{ matrix.python-version }}-${{ hashFiles('dev-requirements.txt') }}-${{ secrets.CACHE_V }} | |
- name: Maybe make venv | |
if: steps.cache-venv.outputs.cache-hit != 'true' | |
run: | | |
python3 -m venv .venv | |
source .venv/bin/activate | |
pip install setuptools wheel | |
pip install ${{ matrix.red-version }} | |
pip install -r dev-requirements.txt | |
pip install jsonrpc-websocket | |
- name: Prepare files | |
run: | | |
mkdir -p /home/runner/.config/Red-DiscordBot | |
echo '{"workflow": {"DATA_PATH": "/home/runner/work/Vex-Cogs/Vex-Cogs/.github/red_data", "COG_PATH_APPEND": "cogs", "CORE_PATH_APPEND": "core", "STORAGE_TYPE": "JSON", "STORAGE_DETAILS": {}}}' > /home/runner/.config/Red-DiscordBot/config.json | |
- name: Run script loadcheck.py | |
run: | | |
source .venv/bin/activate | |
python .github/workflows/scripts/loadcheck.py | |
env: | |
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_TEST_BOT }} | |
- name: Save Red output as Artifact | |
if: always() # still run if prev step failed | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "Red log - Python ${{ matrix.python-version }} & ${{ matrix.friendly-red }}" | |
path: red.log |