Skip to content

Bump actions/setup-node from 3 to 4 #3427

Bump actions/setup-node from 3 to 4

Bump actions/setup-node from 3 to 4 #3427

Workflow file for this run

name: main
on:
push:
pull_request:
schedule:
- cron: '0 6 * * 6'
jobs:
build:
runs-on: ubuntu-latest
env:
HAS_SECRETS: ${{ secrets.TESTS_BOT_USERNAME != '' }}
steps:
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry
- name: Set up python 3.11
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "poetry"
- name: Set up node
uses: actions/setup-node@v4
- name: Cache veekun database
id: veekun-cache
uses: actions/cache@v3
with:
path: veekun.sqlite
key: veekun-${{ hashFiles('cerbottana/data/veekun/*.csv', 'cerbottana/databases/veekun.py', 'cerbottana/tasks/veekun.py') }}
- name: Cache pokemon-showdown instance
uses: actions/cache@v3
with:
path: pokemon-showdown
key: pokemon-showdown-${{ github.run_id }}
restore-keys: |
pokemon-showdown-
- name: Install dependencies on a cache miss
if: steps.setup-python.outputs.cache-hit != 'true'
run: poetry install --sync
- name: Check formatting with black
if: github.event_name != 'schedule'
run: poetry run poe black --check
- name: Check docstrings with darglint
if: github.event_name != 'schedule'
run: poetry run poe darglint
- name: Type check with mypy
if: github.event_name != 'schedule'
run: poetry run poe mypy
- name: Lint with ruff
if: github.event_name != 'schedule'
run: poetry run poe ruff
- name: Test with pytest
if: github.event_name != 'schedule'
run: poetry run poe pytest --cov --cov-report=xml
- name: Upload coverage to Codecov
if: github.event_name != 'schedule'
uses: codecov/codecov-action@v3
- name: Test with pytest (integration)
if: env.HAS_SECRETS == 'true'
env:
USERNAME: ${{ secrets.TESTS_BOT_USERNAME }}
PASSWORD: ${{ secrets.TESTS_BOT_PASSWORD }}
TESTS_MOD_USERNAME: ${{ secrets.TESTS_MOD_USERNAME }}
TESTS_MOD_PASSWORD: ${{ secrets.TESTS_MOD_PASSWORD }}
run: poetry run poe pytest-real-ps-instance